liquidRenderer = $liquidRenderer; } /** * Display a listing of the videos. * * @return \Illuminate\Http\Response */ public function index() { $videos = DistVideo::paginate(10)->where('dist_id', getDistId()); // 每页显示10个视频 return $this->liquidRenderer->render('videos.index', ['videos' => $videos]); } /** * Display the specified video. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $video = DistVideo::findOrFail($id); // 构建导航数据 开始 $breadcrumbs = [ [ 'url' => '/', 'name' => 'Home', ] ]; $category=$video->distVideoCategory; $breadcrumbs[] = [ 'url' => "/videos/{$category->name}", 'name' => $category->name, ]; $breadcrumbs[] = [ 'url' => '#', 'name' => $video->title, ]; return $this->liquidRenderer->render('videos.show', ['video' => $video, 'breadcrumbs' => $breadcrumbs]); } }