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
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
@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.
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.