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

32 lines
747 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
{
/**
* The resource that this resource collects.
*
* @var string
*/
2021-04-09 12:52:54 +02:00
public $collects = BreederForGmap::class;
2021-04-06 16:08:47 +02:00
/**
* Transform the resource collection into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
2021-04-09 12:52:54 +02:00
// @phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
2021-04-06 16:08:47 +02:00
public function toArray($request)
{
2021-04-09 12:52:54 +02:00
return $this->collection->map(function ($breederData) {
return $breederData->googleMapSerialize();
2021-04-06 16:08:47 +02:00
})->all();
}
}