F
Filament8mo ago
jjo63

Accessing the "admin portal" as different user types

Hi all, I wanted to use Filament for 2 different audiences - one is administering the system (users can be manually created as required) the other is those who would use it and would sign-up for use online (i.e. full self-service). I have already created the first kind of user (following the Filament setup instructions). Can I introduce the 2nd type of user to use the same portal? Any guides you can point me at that would explain how that would be achieved?
Thanks in advance, j
18 Replies
LeandroFerreira
LeandroFerreira8mo ago
Filament
Shield by Bezhan Salleh - Filament
The easiest and most intuitive way to add access management to your Filament Panel's Resources, Pages & Widgets through spatie/laravel-permission.
jjo63
jjo63OP8mo ago
Thanks for the suggestion - having a look at that now - does that take care of the use cases I have outlined? Hopefully I have managed to articulate the need succinctly 🙂
LeandroFerreira
LeandroFerreira8mo ago
I think so. You can manage roles and permissions
jjo63
jjo63OP8mo ago
OK thanks - there's much I need to learn. Are you aware of any examples of using filament for self-service (i.e. where the user is registering to use the app themselves - not requiring anyone to set themselves up)?
jjo63
jjo63OP8mo ago
Just been reading this https://github.com/filamentphp/filament/discussions/4400 - so I see that V3 has been designed to support both modes of operation - could anyone point to a high level doc that kind of lays out the sort of structure you'd implement? Will Filament be responsible for presenting the login & login/sign-up pages for admin and public users respectiviely?
GitHub
Filament v3: App framework for the TALL stack · filamentphp filamen...
Ever since Filament launched I've heard of users using our "admin panel" (filament/filament) product for building their entire app. They enjoy the admin panel CRUD features and prebui...
Dennis Koch
Dennis Koch8mo ago
If you want you can build your app for both user types with Filament. You would use different „panels“ for each type. Filament can handle login and registration for your panel.
jjo63
jjo63OP8mo ago
Thanks Dennis - any chance of a pointer to any docs that would set any of this out in more detail?
awcodes
awcodes8mo ago
Just create 2 panels. Each will have its own login Or auth flows. /admin is a different panel than /app However, the authentication and authorization is up to you to handle with policies or middleware.
Dennis Koch
Dennis Koch8mo ago
The whole „panel“ docs 😅
jjo63
jjo63OP8mo ago
I could see that coming 🙂 Coming to this as relatively new to Laravel & PHP - I was really impressed at all the stuff that works straight out of the box (when building an "admin" panel for a POC project). Blending the 2 uses is where I am coming unstuck (for example (and I had committed all work first of course!) I wondered if I could just use "laravel/ui" - when I installed this it asked if I wanted to overwrite my Controller.php file - I said yes with predictable results - access to the admin panels disappeared). Maybe my question should be - given there is support for different panels on different paths, is there any default Filament module that provides the "register or sign-in" process flow? thanks again for any help, j
Dennis Koch
Dennis Koch8mo ago
Maybe explain exactly what you are trying to do.
jjo63
jjo63OP8mo ago
OK
Dennis Koch
Dennis Koch8mo ago
Maybe my question should be - given there is support for different panels on different paths, is there any default Filament module that provides the "register or sign-in" process flow?
That comes out of the box but it coupled to the Panel. If you want independent Auth you might want to look into Laravel Breeze Some bullet points should be enough. But explain what you are looking for and what not
jjo63
jjo63OP8mo ago
Platform will manage records of users' possessions. There will be 2 classes of user - the /app is self-service - users sign-up and can then manage own inventory (CRUD plus other features) - the sign-up process should include 2FA (ideally). These are the consumers of the app (volume users). A separate kind of access is required for admin - managing the system, looking at stats, managing dropdown lists etc. - this latter class of user can be created for example simply using e.g. php artisan make:filament-user Is that ok (sufficient info)?
Dennis Koch
Dennis Koch8mo ago
Okay. So if you want, you can use Filament for both. Both are different "Panels" (/app and /admin). Filament provides registration and login features for every Panel. 2FA is possible through #jeffgreco-breezy plugin.
jjo63
jjo63OP8mo ago
Really appreciate you taking the time Dennis - thanks so much.
jjo63
jjo63OP8mo ago
So - reading this - https://filamentphp.com/docs/3.x/panels/installation It sort of jumps from installation, create a first user and then access the /admin path - it doesn't explain how to create a panel on a path (e.g. /admin or /app) of your choice. Clearly (?) the install is creating defaults for an initial /admin path - is that documented somewhere (either the defaults or the method to create a 2nd panel)?
jjo63
jjo63OP8mo ago
Want results from more Discord servers?
Add your server