From 42982a8b369d4c34f7ac45bc335627983e104422 Mon Sep 17 00:00:00 2001 From: xuanchen <122383162@qq.com> Date: Wed, 13 Jan 2021 13:41:06 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=20=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E5=B7=A6=E4=BE=A7=E5=8A=A0=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/ArticleController.php | 6 +-- resources/views/article/show.blade.php | 61 +++++++++++++++------- 2 files changed, 46 insertions(+), 21 deletions(-) diff --git a/app/Http/Controllers/ArticleController.php b/app/Http/Controllers/ArticleController.php index a874a3e..9ddad7a 100644 --- a/app/Http/Controllers/ArticleController.php +++ b/app/Http/Controllers/ArticleController.php @@ -11,8 +11,8 @@ class ArticleController extends Controller /** * 显示分类 - * @param Category $category [description] - * @return [type] [description] + * @param \App\Models\Article $article + * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View [type] [description] */ public function show(Article $article) { @@ -24,7 +24,7 @@ class ArticleController extends Controller ->where('status', 1) ->first(); - return view('article.show', compact('article', 'next', 'parent')); + return view('article.show', compact('article', 'next', 'parent', 'category')); } diff --git a/resources/views/article/show.blade.php b/resources/views/article/show.blade.php index f8fbd1b..2a3e7a5 100644 --- a/resources/views/article/show.blade.php +++ b/resources/views/article/show.blade.php @@ -3,26 +3,51 @@ @section('title', '文章详情') @section('content') - +
发表时间:{{ $article->created_at }}
-- {!! $article->content !!} -
-{{ $category->description }}
发表时间:{{ $article->created_at }}
++ {!! $article->content !!} +
+