© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
2 replies
charliefortune

Convert Eloquent relationship to query builder for table?

Is it possible to use Eloquent relationships in the getTableQuery() method of the table builder? I want to do this because I have all of the relationships I want to use built as relationships, so rewriting them as queries seems like duplication.

I also realise that I could use query scopes - but this also feels like duplication, as I wouldn't need the scopes anywhere else.

I understand the table builder needs a query builder though - so I wondered if there was a way to convert something like a HasMany to an Eloquent query builder so I can use it in this way.
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Convert model method to eloquent relationship
FilamentFFilament / ❓┊help
2y ago
Help on table eloquent relationship
FilamentFFilament / ❓┊help
2y ago
How to use "tableSearch" query string in table builder?
FilamentFFilament / ❓┊help
3y ago