for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Adminetic\Website\Http\Resources\Event;
use Illuminate\Http\Resources\Json\JsonResource;
use Adminetic\Website\Http\Resources\Gallery\GalleryResource;
class EventResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
return [
'type' => 'events',
'id' => (string) $this->id,
id
Adminetic\Website\Http\R...ces\Event\EventResource
__get
'attributes' => parent::toArray($request),
'links' => [
'self' => adminShowRoute('event', $this->id)
adminShowRoute
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
'self' => /** @scrutinizer ignore-call */ adminShowRoute('event', $this->id)
]
];
}
* Get additional data that should be returned with the resource array.
public function with($request)
'relationships' => [
'gallery' => GalleryResource::collection($this->whenLoaded('gallery')),
],