ldc-legaulois/app/Http/Resources/BreederMapCollection.php

24 lines
603 B
PHP
Raw Normal View History

2021-04-06 16:08:47 +02:00
<?php
namespace App\Http\Resources;
2021-04-09 12:52:54 +02:00
use App\Models\BreederForGmap;
2021-04-06 16:08:47 +02:00
use Illuminate\Http\Resources\Json\ResourceCollection;
class BreederMapCollection extends ResourceCollection
{
/**
* Transform the resource collection into an array.
*
* @param mixed $request
2021-04-06 16:08:47 +02:00
* @return array
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
2021-04-06 16:08:47 +02:00
*/
public function toArray($request)
{
return $this->collection->map(function (BreederForGmap $breederData) {
2021-04-09 12:52:54 +02:00
return $breederData->googleMapSerialize();
2021-04-06 16:08:47 +02:00
})->all();
}
}