How to Authenticate User based on their Status, and also hide few Resource Pages based on the Role

Sorry if this has already been asked but I couldn't find it, I want to basically whenever someone is trying to login into the dashboard, I want to also check if the user being logged in has their Status='Approved' or not in the SQL Table, I just have the base authentication page automatically made so I am not sure where to edit it, and also it would be great if it could also show an error saying the user is not approved.
and also, I have some pages like Users, Products etc that I only want to show for the admin and I have a column called 'role' in my database and there are two types, Admin and User
Thank you!
Solution
and also, I have some pages like Users, Products etc that I only want to show for the admin and I have a column called 'role' in my database and there are two types, Admin and User

Laravel model policies can be used for this. The Filament docs explain it more, and the Laravel docs explain how to create the policy and how it works.
https://filamentphp.com/docs/3.x/panels/resources/getting-started#authorization
https://laravel.com/docs/authorization#creating-policies
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.
Was this page helpful?