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->title }}

-

发表时间:{{ $article->created_at }}

-
-
-{{-- @if ($article->cover)--}} - {{-- --}} - {{-- @endif--}} -

- {!! $article->content !!} -

-
- @if ($next) -
- 下一篇{{ $next->title }} + +
+
+ {{ $category->title }} +

{{ $category->description }}

- @endif + +
+ +
+ +
+
+

{{ $article->title }}

+

发表时间:{{ $article->created_at }}

+
+
+ {{-- @if ($article->cover)--}} + {{-- --}} + {{-- @endif--}} +

+ {!! $article->content !!} +

+
+ @if ($next) +
+ 下一篇{{ $next->title }} +
+ @endif + +
+ +
- + + @endsection