30 lines
820 B
PHP
30 lines
820 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Advert;
|
|
use App\Models\Article;
|
|
|
|
class ArticleController extends Controller
|
|
{
|
|
|
|
/**
|
|
* 显示分类
|
|
* @param \App\Models\Article $article
|
|
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View [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'));
|
|
// return view('article.show', compact('article', 'parent', 'category','advert'));
|
|
|
|
}
|
|
|
|
}
|