© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
14 replies
setiawanh

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
Adding a table to a Livewire component - Table Builder - Filament
Solution
Thanks, Dennis. I think I am getting somewhere. I tried as follow:
public function table(Table $table): Table
{
        return $table
            ->query(Employee::query()->leftJoin('attendances','employees.id','=','attendances.employee_id'))
            ->columns([
                TextColumn::make('first_name'), // column exists in Employee table and is showing
                TextColumn::make('result'), // column exists in Attendances table but is NOT showing
            ])...
}
public function table(Table $table): Table
{
        return $table
            ->query(Employee::query()->leftJoin('attendances','employees.id','=','attendances.employee_id'))
            ->columns([
                TextColumn::make('first_name'), // column exists in Employee table and is showing
                TextColumn::make('result'), // column exists in Attendances table but is NOT showing
            ])...
}

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!
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Filament table builder with union query
FilamentFFilament / ❓┊help
15mo ago
Custom query table
FilamentFFilament / ❓┊help
3y ago
Filament Custom Page Multiple Tables
FilamentFFilament / ❓┊help
15mo ago
Custom Reports using Filament Tables
FilamentFFilament / ❓┊help
3y ago