© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
30 replies
mohdaftab

how to access public variable in getEloquentQuery

Hello,
I am using getEloquentQuery and adding request()->buyer_id in the query and it works fine but when I use sorting it just disappears the data unless I hard code the buyer_id to the query. My question is how do I put the buyer_id in a public variable and access it in getEloquentQuery function please?
image.png
Solution
You could try
fn ($livewire)
fn ($livewire)
but this query is also used on Edit/Create page. Best to overwrite
getTableQuery()
getTableQuery()
on the ListPage
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

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Public Variable
FilamentFFilament / ❓┊help
3y ago
Public variable()
FilamentFFilament / ❓┊help
3y ago
How to use table filters in getEloquentQuery?
FilamentFFilament / ❓┊help
2y ago
getEloquentQuery() in the RelationManager
FilamentFFilament / ❓┊help
2y ago