34 lines
671 B
PHP
34 lines
671 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
use App\Models\Video;
|
|
|
|
class VideoController extends Controller
|
|
{
|
|
|
|
/**
|
|
* Notes: description
|
|
*
|
|
* @Author: 玄尘
|
|
* @Date : 2021/10/8 14:54
|
|
* @param \App\Models\Video $video
|
|
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
|
*/
|
|
public function show(Video $video)
|
|
{
|
|
|
|
$parent = $category = $video->category;
|
|
|
|
if ($category->childrens->isEmpty() && $category->parent) {
|
|
$parent = $category->parent;
|
|
}
|
|
|
|
|
|
return view('video.show', compact('video', 'parent', 'category'));
|
|
|
|
}
|
|
|
|
}
|