]> git.localhorst.tv Git - alttp.git/commitdiff
pull crew user
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 20 Feb 2023 22:50:11 +0000 (23:50 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 20 Feb 2023 22:50:11 +0000 (23:50 +0100)
app/Http/Controllers/EpisodeController.php

index c20ad64f63dec5fce037507aa29e68e11bd4015b..d1e7e85612d08c7c1417fdda2df2f07f4a0bbaef 100644 (file)
@@ -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();