How to show a table with only records that belong to the authenticated user?
Hi, I'm building a sample Filament site to practice and learn. I'm stuck on how I can make a resource only show records that belong to the authenticated user. For example, in my
products
table, I have a user_id
column. I only want to show records that match user_id
with auth()->user()->id
in my Filament table.6 Replies
Hey
One way to solve this would be with using global scopes
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
Filament will use all global scopes by default
Solution
An other, more localised option would be setting the resource query
Exactly what I was looking for. Thank you.