Conditionally hide action button.
I have created an Action.
Everything is working fine with the code below. When the action button is used the modal appears, and after confirming 'marked_ready_at' gets the current date/time.
I want to hide or disable the action button "Mark Ready" when "marked_ready_at" has a date/time.
Any suggestion on how I can achieve this?
Thanks.
4 Replies
https://beta.filamentphp.com/docs/3.x/actions/modals#conditionally-hiding-the-modal I'd probably look at this.
Solution
use
->hidden(fn () => (bool) $this->record->marked_ready_at)
or
->disabled
the same wayThank you so much... it worked nicely.