custom action
I'm staring blind at the documentation. I clearly don't understand how it works.
I want to have a custom row action in a resource table (e.g. next to view/edit/delete I'd like to see 'pay'). Clicking this should bring the user to a separate page where information is shown about the product and which contains a button to pay
How can this be done?
Solution:Jump to solution
1. Yes sounds good to me. Create a page, register it on your resource. You don’t need a redirect then
->url()
on the action should be fine.
2. That’s just basic livewire wire:click="yourMerhod"
. Check the LW docs....4 Replies
What‘s the issue? You didn’t found the right stuff in the docs or don’t know how to apply?
I have created an Action that looks as follows:
Action::make('Pay')
->action(fn () => redirect()->route('...')),
I see this action in the product table. When a user clicks on this action, he/she needs to go to a page containing some product details and containing a button to pay for it.
- Guess I need to create a custom page using php artisan make:filament-page
?
- How can a button on that custom page execute a public function in a Livewire controller?
Not sure at all if these two bullet points are the way to go about this?Solution
1. Yes sounds good to me. Create a page, register it on your resource. You don’t need a redirect then
->url()
on the action should be fine.
2. That’s just basic livewire wire:click="yourMerhod"
. Check the LW docs.