How do I change the modal text of a custom Action?

I have a simple custom Action and I'm using ->requiresConfirmation(). All that I want is to change the heading, subheading and button label. I already checked this part of the documentation https://filamentphp.com/docs/2.x/admin/pages/actions#setting-a-modal-heading-subheading-and-button-label and added this ->modalHeading('Delete posts') ->modalSubheading('Are you sure you'd like to delete these posts? This cannot be undone.') ->modalButton('Yes, delete them') Which is the example on the docs, but nothing changes. I already clear the cache on the laravel app, but nothing. Is there something else that I need to do?
Filament
Actions - Pages - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
4 Replies
LeandroFerreira
LeandroFerreira16mo ago
Maybe the issue is the order of methods. You may try this:
->requiresConfirmation()
->modalHeading('Delete posts')
->modalSubheading('Are you sure you\'d like to delete these posts? This cannot be undone.')
->modalButton('Yes, delete them')
->requiresConfirmation()
->modalHeading('Delete posts')
->modalSubheading('Are you sure you\'d like to delete these posts? This cannot be undone.')
->modalButton('Yes, delete them')
barrerakj
barrerakj16mo ago
That's exactly what I tried. I literally copied the example on the docs
LeandroFerreira
LeandroFerreira16mo ago
should work. Can you share the code please?
barrerakj
barrerakj16mo ago
Holly cow, it was the escaped quote I think. I guess I didn't notice that. I'm not even sure why did I not get a warning or other message. Thanks for the help. If it wasn't that, I can't explain why now it works.