forked from projects/thebadspace
25 lines
571 B
PHP
25 lines
571 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Resources;
|
||
|
|
||
|
use Illuminate\Http\Request;
|
||
|
use Illuminate\Http\Resources\Json\ResourceCollection;
|
||
|
|
||
|
class LocationCollection extends ResourceCollection
|
||
|
{
|
||
|
/**
|
||
|
* Transform the resource collection into an array.
|
||
|
*
|
||
|
* @return array<int|string, mixed>
|
||
|
*/
|
||
|
public function toArray(Request $request): array
|
||
|
{
|
||
|
//return parent::toArray($request);
|
||
|
|
||
|
return [
|
||
|
'listingCount' => count($this->collection),
|
||
|
'locations' => LocationResource::collection($this->collection),
|
||
|
];
|
||
|
}
|
||
|
}
|