Infolist - send data to Action
Hi - I need some help on creating an Infolist-Action. As you can see on the screenshot, I have a Chekpoint that has multiple tags. When a user clicks on the red button, the tag is beeing removed from the checkpoint. Right now I have this code:
But
$tag
comes in as an empty model. If I use $data
instead of $tag
, I get an empty array. I already tried to use ->formFill(['tag_id' => $tag->id])
, but to no avail.
How do I send the tag-ID to the action? The relationship between Checkpoint -> Tag is BelongsToMany.
Thanks.Solution:Jump to solution
Try passing it to the function via
use ($tag)
. Filament doesn’t know about your tag so it can’t inject it as an argument5 Replies
Solution
Try passing it to the function via
use ($tag)
. Filament doesn’t know about your tag so it can’t inject it as an argumentWorked! Thanks Dennis. 🙂
Do you also have an idea on how to fix the weird looking buttons? As soon as I set
label(false)
but keep an icon, the icon is not centered inside the button. I ain't sure if I do something wrong or if Filament has trouble creating "icon-only"-buttons.try
iconButton()
instead of button()
Then it looks like this - I would prefer to have just the icon as label you know. 🙂