refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
This commit is contained in:
24
app/ExportResources/CountResourceCollection.php
Normal file
24
app/ExportResources/CountResourceCollection.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\ExportResources;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
|
||||
|
||||
class CountResourceCollection extends AnonymousResourceCollection
|
||||
{
|
||||
/**
|
||||
* Transform the resource into a JSON array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'count' => $this->count(),
|
||||
'type' => Str::of($this->collects)->afterLast('\\')->kebab()->replace('-', '_'),
|
||||
'values' => parent::toArray($request),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user