调整视频详情页
This commit is contained in:
33
app/Http/Controllers/VideoController.php
Normal file
33
app/Http/Controllers/VideoController.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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'));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user