Filter from Accessor
Hello Together,
i'm using Laravel Venture for Workflow Jobs, and i have set in my model a Accessor. That gives me for every row a output if the workflow is running or failed or was canceled as string.
in my Table in Filament this works very well and every row has his Data from the Accessor.
now i want to implement a filter to the Table where i can filter via the accessor string, but this don't work out until now.
this is my Accessor in the Model :
any idea how i can filter by the returned Strings ? 🙂
Thanks
Solution:Jump to solution
@Frittenfred it doesn't work for a reason: accessors are called and values formed AFTER the main query of Eloquent which contains all the filtering.
Maybe you can make filters work by reworking how your accessors work to make the same logic called in a custom filter but it's quite a "hacky" way....
3 Replies
Solution
@Frittenfred it doesn't work for a reason: accessors are called and values formed AFTER the main query of Eloquent which contains all the filtering.
Maybe you can make filters work by reworking how your accessors work to make the same logic called in a custom filter but it's quite a "hacky" way.
yeah i was thinking that allready, no SQL Row, so no Query. okay, thank you very much @PovilasKorop 🙂
Thinking about it, it would be a pretty interesting challenge to make it work, putting your accessor logic elsewhere in some kind of a Service class that would be reused by both filter and accessor. But unfortunately don't have time atm to play around with it 🙂