I'm starting with laravel/filamentphp in version 10 and I want to automatically filter the table of a resource so that the current user looks only at its records that I capture.
I have the “user” model related to the “sale” model through the user id, that is, in the “sale” migration table I have:
$table->foreignId('user_id')->constrained('users')->cascadeOnDelete();
and in the main index (table) of the “sale” resource the user ID appears in the corresponding record that was captured.
But I can't or rather I don't know how to make a query to filter by user and their id automatically.
I hope you can guide me and give me support.thank you
Filter resource table by registered user id or current user.