© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
27 replies
Billi 🌻

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
Getting started - Panel Builder - Filament
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.
Laravel - The PHP Framework For Web Artisans
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
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Hide a resource widget based on the resource status
FilamentFFilament / ❓┊help
3y ago
Hide SelectColumn based on soft delete status
FilamentFFilament / ❓┊help
3y ago
How to Hide Panel Icons Based on User Roles and Order Panels
FilamentFFilament / ❓┊help
2y ago
How to hide resource breadcrumb?
FilamentFFilament / ❓┊help
3y ago