$playlists = Playlist::onlyTrashed()->with('songs')->get();
foreach ($playlists as $playlist) {
foreach ($playlist->songs as $song) {
//
}
}
$playlists = Playlist::onlyTrashed()->get()->pluck('id');
$songs = Song::whereIn('playlist_id', $playlists)->orderBy(...)->get();
$flavours = collect($request->name)->map(function ($value) {
return ['name' => $value];
})->all();
DB::table('flavours')->insert($flavours);
public function platforms() {
return DB::table('game_platforms')
->join('platforms', 'platforms.id', '=', 'game_platforms.platform_id')
->where('game_platforms.game_id', '=', $this->id)
->get();
}