File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
app/Http/Controllers/Articles Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -28,13 +28,14 @@ public function index()
2828
2929 public function show (Article $ article )
3030 {
31- if ($ article ->isPublished () || (Auth::check () && $ article ->isAuthoredBy (Auth::user ()))) {
32- return view ('articles.show ' , [
33- 'article ' => $ article ,
34- ]);
35- }
36-
37- abort (404 );
31+ abort_unless (
32+ $ article ->isPublished () || (Auth::check () && $ article ->isAuthoredBy (Auth::user ())),
33+ 404
34+ );
35+
36+ return view ('articles.show ' , [
37+ 'article ' => $ article ,
38+ ]);
3839 }
3940
4041 public function create (Request $ request )
Original file line number Diff line number Diff line change 77@section (' content' )
88 <div class =" max-w-screen-md mx-auto p-4 pt-8" >
99 <h1 class =" text-4xl tracking-tight leading-10 font-extrabold text-gray-900 sm:leading-none mb-4" >{{ $article -> title () } } </h1 >
10- @if ($article -> isNotPublished () )
10+ @if ($article -> isNotPublished () )
1111 <span class =" label inline-flex mb-4" >
1212 Draft
1313 </span >
You can’t perform that action at this time.
0 commit comments