Redirect after custom action
Hi, I have a PostResource with a table, where users can top their posts, which creates a payment. I would like to redirect the user to the PaymentResource with a specific ID of Payment in infolist, which I want to show in modal. How can I do it, please?
So far I have this code:
PostResource in table:
Thank you for help.
11 Replies
Anyone, please? 😔
Maybe inject $livewire into the action() callback and $livewire->redirect()
I made so far in the action function:
made custom page with view record parameter and view-payment.blade file:
but this opens a whole new page, not the modal as I want to
Maybe I’m just not understanding. A redirect will always open another page. That’s what a redirect does.
Are you trying to swap the modal.?
I have a PostResource, where there is an action to top the post. After clicking the custom action "top", it creates a Payment with the current post_id what user wants to top. After the Payment is created, I have a PaymentResource, where I want the user to be redirect, or just simply show him $infolist in the PaymentResource, where are all details to pay for topping the post.
The custom action in PostResource:
The infolist (I want to show after redirect in modal) in the PaymentResource:
Try something like this
Hi, that doesn't, it opens the page, not the modal after the redirect
😕
Redirects aren’t going to open a modal. You need an action to do that.
How could I do that, please? Sorry, I'm new in the Filament
Thanks.