From: Daniel Karbach Date: Mon, 20 Feb 2023 22:50:11 +0000 (+0100) Subject: pull crew user X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=6a5969b5d9bc6f68cdd85429251182bdd0e1d852;p=alttp.git pull crew user --- diff --git a/app/Http/Controllers/EpisodeController.php b/app/Http/Controllers/EpisodeController.php index c20ad64..d1e7e85 100644 --- a/app/Http/Controllers/EpisodeController.php +++ b/app/Http/Controllers/EpisodeController.php @@ -26,12 +26,13 @@ class EpisodeController extends Controller ->orderBy('episodes.start') ->limit(1000); if ($request->user() && $request->user()->isPrivileged()) { - $episodes = $episodes->with('crew'); + $episodes = $episodes->with(['crew', 'crew.user']); } else { $episodes = $episodes->with([ 'crew' => function ($query) { $query->where('confirmed', true); - } + }, + 'crew.user', ]); } return $episodes->get()->toJson();