Help: Filament Action Record Context Issue - Custom Implementation
Hey everyone! I'm working with Filament actions in a custom context and running into an issue with record context.
The Problem:
In my blade template, when I
dd($action)
it shows the record is attached β
But when the action executes (user clicks), $record is null in the callback β
Blade:
What works:
1. Native Filament table actions automatically get the record
2. Setting record explicitly with closure in action definition
Question:
How does Filament's native table actions automatically inject the record during execution?
Any insights on replicating Filament's internal record injection mechanism for custom action implementations?
Thanks! π5 Replies
Any one have any Idea about it, Please suggest some approach
I have a similar issue and came up with an ugly workaround. I imagine there is a better solution, but I don't know it.
Something like this might work for you:
@kschwab Thanks for the reply,
I tried this approach as well, but it still triggers a fresh query on every action.
Unless I'm mistaken, I think that's what the native Filament tables do as well. Diving into the source, it looks like Filament queries for the record in the method in
You are right @kschwab thanks!