where('preview_token', $token) ->firstOrFail(); return response()->file(public_path('_cabinet/display/index.html'), [ 'Cache-Control' => 'no-cache, must-revalidate', ]); } public function config(string $token, DisplayPlaylistConfigBuilder $configBuilder): JsonResponse { $display = Display::query() ->where('preview_token', $token) ->firstOrFail(); $playlist = $display->draftPlaylist() ->with('modules.items') ->first(); if (! $playlist || $playlist->modules->isEmpty()) { return response()->json(['error' => 'Display preview not configured'], 404); } return response()->json($configBuilder->fromPlaylist($playlist)); } }