Open a modal or slide over with table Action

Hi everyone! I have a Users table and I'd like to open a custom modal or slide over to manage their permissions. I'd like to do it without creating a new Page with Livewire. In the image below an example of the table. Thank you so much for the help!
No description
4 Replies
toeknee
toeknee9mo ago
Create an Action and then use ->form() and ->action() and you can also user ->sliceOver()
Davide Cariola
Davide Cariola9mo ago
Hi, and thank you for the reply. I'm sorry, I didn't get it. Can you please expand?
Davide Cariola
Davide Cariola9mo ago
Hey, I think I've got it. I created a new livewire component and then in my table I created this action:
Action::make('ManagePermissions')
->action(fn(User $record) => $record->advance())
->modalContent(fn(User $record) => view('livewire.user.permission-slide-over', ['record' => $record]))
->slideOver(),
Action::make('ManagePermissions')
->action(fn(User $record) => $record->advance())
->modalContent(fn(User $record) => view('livewire.user.permission-slide-over', ['record' => $record]))
->slideOver(),
Works as a charm. Thank you! I'll leave here also the documentation part, for other users: https://filamentphp.com/docs/3.x/actions/modals
toeknee
toeknee9mo ago
No problem! That’ll do it!