Custom Filament Table with Query of Left Joined Tables
I have managed to create livewire component with filament table in it as described here:
https://filamentphp.com/docs/3.x/tables/adding-a-table-to-a-livewire-component
In the example, the query for the table is given for a single model. (Product::query())
How can I pass the query for the filament table so that it will take 2 joined tables?
SELECT * FROM employees LEFT JOIN attendances ON employees.id = attendances.employee_id
https://filamentphp.com/docs/3.x/tables/adding-a-table-to-a-livewire-component
In the example, the query for the table is given for a single model. (Product::query())
How can I pass the query for the filament table so that it will take 2 joined tables?
SELECT * FROM employees LEFT JOIN attendances ON employees.id = attendances.employee_id
Solution
Thanks, Dennis. I think I am getting somewhere. I tried as follow:
It seems to run correctly but the "result" column which supposes to get the data from the "attendances" table is not showing. Did I miss anything? Thanks!
It seems to run correctly but the "result" column which supposes to get the data from the "attendances" table is not showing. Did I miss anything? Thanks!