Skip to content

Commit ae106db

Browse files
committed
Formatting
1 parent c7ef826 commit ae106db

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

app/Http/Controllers/Articles/ArticlesController.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff 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)

resources/views/articles/show.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
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>

0 commit comments

Comments
 (0)