Repeater: How can I conditionally show/hide Delete button in Repeater?
I have multiple notes attached with per contact, so I am using Repeater. I want to make sure that if note is more than 2 days old then it cannot be deleted, otherwise delete it allowed.
Thanks
6 Replies
You should check (array $arguments, Repeater $component) inject in action button
Thanks @yagrasdemonde I will look into it
when I tried the following code, the problem is that even for new notes (which are not saved yet in db, for those also I am getting same id as of the item which is saved in db.
Resulting in an issue where I am not able to hide the delete button conditionally (if record is not saved in db then show delete button otherwise do not)
I also tried following
@yagrasdemonde Thank you for your help.
IS this a relationship repeater?
yes @toeknee and I am just able to get the active repeater state using the following code
I am can also use or instead of but for some reason visible/hidden are not actually hiding the delete button but just making it disabled.
I found help from https://github.com/filamentphp/filament/discussions/8403
GitHub
Repeater conditional deletable per item · filamentphp filament · Di...
Hello Expert Can you guide me please on how to show delete action for selected Repeater items? I don't want to allow user to delete all items, some items are mandatory, so I want to remove the ...