ldc-legaulois/app/Http/Resources/BreederMapCollection.php
Jérémy Munsch f8fc756b30 Finished GMap
2021-04-09 12:52:54 +02:00

31 lines
747 B
PHP

<?php
namespace App\Http\Resources;
use App\Models\BreederForGmap;
use Illuminate\Http\Resources\Json\ResourceCollection;
class BreederMapCollection extends ResourceCollection
{
/**
* The resource that this resource collects.
*
* @var string
*/
public $collects = BreederForGmap::class;
/**
* Transform the resource collection into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
// @phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
public function toArray($request)
{
return $this->collection->map(function ($breederData) {
return $breederData->googleMapSerialize();
})->all();
}
}