Users be able to view only their Data's
I have two roles in Users table, Beside the admin role i want the user only view the data that their id is equal to the useradd column in the database, I tried policy but it not works on the view and viewAny, I will be appreciate anyone who can help me
thanks
1 Reply
Read up on query scopes at https://laravel.com/docs/10.x/eloquent#query-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.