Why delete modal has acition label 'confirm' instead of 'delete'?
If it is not overlooked and default, how can I update it globally?
I checked language files it suggest label should be 'delete' but i see confirm
Solution:Jump to solution
It doesn’t care what the action is, just that it doesn’t execute the action without confirmation.
8 Replies
Because it’s a confirmation modal, it can apply to more than just delete.
Don't you think it needs an update? I think $this->requiresConfirmation(); should come before setting labels in the delete action.
Because in the delete action, labels are set correctly, but $this->RequiresConfirmation() overwrites them?
I think it will be good for all actions that requires confirmation by default
Aww, you’re a core team member! Would you suggest making a PR? I’d be glad to contribute.
Where are you calling
$this->requiresConfirmation()
it should read all the labels correctly.The delete action is manually setting all the labels, so you should be able to do the same. https://github.com/filamentphp/filament/blob/3.x/packages/actions/src/DeleteAction.php
GitHub
filament/packages/actions/src/DeleteAction.php at 3.x · filamentph...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament
Where are you calling $this->requiresConfirmation() it should read all the labels correctly.I do not; it is included in the default delete action class. Originally, I wanted to change the label of the delete modal confirm action globally. I checked the language files, but saw 'delete' in the translation, but 'confirm' on the modal. I suspected it was due to the default requiresConfirmation () thing and your answer made all clear.
Yea. The confirmation modal is generic as it should be.
Solution
It doesn’t care what the action is, just that it doesn’t execute the action without confirmation.
Sure, thanks 🙏