Files
new_ine/app/Http/Controllers/ArticleController.php
2020-09-14 14:29:29 +08:00

29 lines
622 B
PHP

<?php
namespace App\Http\Controllers;
use App\Models\Advert;
use App\Models\Article;
class ArticleController extends Controller
{
/**
* 显示分类
* @param Category $category [description]
* @return [type] [description]
*/
public function show(Article $article)
{
$parent = $category = $article->category;
if ($category->childrens->isEmpty()) {
$parent = $category->parent;
}
$advert = Advert::where('category_id',73)->first();
return view('article.show', compact('article', 'parent', 'category','advert'));
}
}