Livewire

Authorization in Livewire v4 Components

February 01, 2026 1 min read 15 views

Protect actions with Laravel authorization.

Using authorize()

public function delete(Post $post): void
{
    $this->authorize('delete', $post);
    $post->delete();
}

In View

@can('delete', $post)
    
@endcan
Share this post:

Related Posts

Comments (0)

Please log in to leave a comment. Log in

No comments yet. Be the first to comment!