F
Filament9mo ago
Flu

Computed Property Filter On Table Builder?

Hey, I'm using Filament Tables outside of Filament just to quickly bootstrap an app I'm using a service and calling a method that returns an enum of strings, this shows fine in my table:
StatusColumn::make(name: 'status')
->state(state: function (EmployeeService $employeeService, Employee $record): string {
return $status = $employeeService->calculateStatus($record)->value;
})
StatusColumn::make(name: 'status')
->state(state: function (EmployeeService $employeeService, Employee $record): string {
return $status = $employeeService->calculateStatus($record)->value;
})
it's a computed property with a few nested many to many relationships and calculations to get the value I'm trying to workout how I can add a filter for this property, does anyone have any examples or suggestions? It's not stored in the DB and has to be computed
Solution:
Update: I ended up wrapping it into a DTO as I needed to anyway and then using a Data Collection for my data using Sushi: https://filamentphp.com/community/how-to-consume-an-external-api-with-filament-tables...
Filament
How to consume an external API with Filament Tables by Leandro Ferr...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
Jump to solution
3 Replies
awcodes
awcodes9mo ago
I don’t think there’s a way to search on that. The search depends on an eloquent query. So it would have to at least be a virtual column on the table.
Flu
FluOP9mo ago
yeah I thought as much, thank you
Solution
Flu
Flu9mo ago
Update: I ended up wrapping it into a DTO as I needed to anyway and then using a Data Collection for my data using Sushi: https://filamentphp.com/community/how-to-consume-an-external-api-with-filament-tables
Filament
How to consume an external API with Filament Tables by Leandro Ferr...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
Want results from more Discord servers?
Add your server