When do you use multiple panels?

I have this project where both admin and user stuff are in the default AdminPanelProvider, the access control is done via checking the permissions/role of the User. However, for cases where assuming admin and users has different workflows, wouldn't it be much better if they have their own dedicated panels? In this case there will be: AdminPanel and UserPanel. Though personally I would rather have different panels, although maintaining them whenever there's a change/new feature can be quiet taxing. This is more of a discussion, I'm just curious what are the other devs will do in this scenario.
3 Replies
pinpointzero
pinpointzero3mo ago
Hi Null, I have a specific project where I have six separate panels. One for a super-admin who can (literally) do anything, another for admin to manage users, and then the other four for separate user-types. You can have one panel, and make sure that all of the resources you present are tailored depending on the user who is logged in, but, I find the separation of panels a separation of concerns, and it's cleaner. Also, you can use Laravel's built-in Policy system to ensure that only certain users can access panels, and to reduce resource code footprint, you can use Laravel Macros.
toeknee
toeknee3mo ago
That i a normal scenario yes, and you can re-use code between both. We use some for deparments and some of clients and some of admins.
CodeWithDennis
CodeWithDennis3mo ago
You can also reuse certain parts in both panels to avoid writing the same code repeatedly. (Extract them to components).
Want results from more Discord servers?
Add your server