F
Filament3mo 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
awcodes3mo 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
Flu3mo ago
yeah I thought as much, thank you
Solution
Flu
Flu3mo 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
More Posts
Navigation Groups & navigationParentItem not workingHello, I have a ViewPage and its $navigationGroup is set to 'Group' but the link doesn't show up undHow to test list table search in translatable (via spatie) field with pestI have the following test: ```it('can search page by tistle', function () { $title = Page::fListening for broadcast eventsHi folks Been working with filament for a little bit now and really enjoying it. I’ve been buildinPassword (and other fields) truncates themselves on screen (possibly due to live())Hi, I'm after some guidance on how best to debug this. When entering a password (or some text inputHow can I apply a class to fi-fo-field-wrp?have a grid, and I'm supplying extra attributes, but it's going to the parent grid (obviously) and iis that possible to sum 2 columns in tableHi i want to make new column that sum 2 columns in laravel filament, is that possible? Thank you!Filament resource for MarkableI'm using [this](https://github.com/maize-tech/laravel-markable) package. It works well however I woUncaught (in promise) Component not foundI have a delete action on my livewire component., which is an edit modal/slideover. It's working finTextArea with autosize resets to default size with Live event.Before I report this as a bug, I'd like to know if this is expected behaviour. I have a very simplesetting a custom homeUrl after login doesn't seem to worki have a new panel created and set the `homeUrl('calendar')` but everytime I login on the new panel,