Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

relationship in laravel

N + 1
return new SongsCollection(Song::with('album')->get());

'songs' => SongResource::collection($this->whenLoaded($this->songs))
 
PREVIOUS NEXT
Tagged: #relationship #laravel
ADD COMMENT
Topic
Name
2+5 =