Skip to content

Commit

Permalink
nuclear
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Oct 3, 2023
1 parent fea5da2 commit f2c5ceb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion resources/views/pages/[post].blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
use App\Models\Post;
use App\Models\Ad;
render(function(View $view, Post $post) {
render(function(View $view, Post|string $post) {
if (is_string($post)) {
$post = Post::findByIdSlug($post);
if (! $post) {
abort(404);
}
}
$ad = Ad::getForCurrentPage();
abort_unless($post->shouldShow(), 404);
Expand Down

0 comments on commit f2c5ceb

Please sign in to comment.