Skip to content

Commit

Permalink
🔒feat(http): add gate check for showing edit post
Browse files Browse the repository at this point in the history
  • Loading branch information
momcilovicluka committed Oct 27, 2024
1 parent e870981 commit d401635
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/Http/Controllers/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ public function edit($id)
{
$post = Post::findOrFail($id);

Gate::authorize('update', $post);

return Inertia::render('Post/EditPost', [
'post' => $post,
]);
Expand Down

0 comments on commit d401635

Please sign in to comment.