31 lines
747 B
PHP
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();
|
|
}
|
|
}
|