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.
|
|
|
|
|
*
|
2022-03-02 16:33:49 +01:00
|
|
|
* @param mixed $request
|
2021-04-06 16:08:47 +02:00
|
|
|
* @return array
|
2022-03-02 16:33:49 +01:00
|
|
|
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
|
2021-04-06 16:08:47 +02:00
|
|
|
*/
|
|
|
|
|
public function toArray($request)
|
|
|
|
|
{
|
2022-03-02 16:33:49 +01:00
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}
|