Hi !
I have finished the first part of my app by creating CRUD actions on my Many-to-Many relationships (Trainings-Users-Groups) and now I'd like to make the member area.
Members will have the same layout but of course won't be able to access the CRUD action admin is and also will have different views.
I don't really need at the moment a fully-role-based package but with a simple Member/admin filed in the user table, it would be fine.
I have read some articles with different approaches and I'd like to have some advice before going to code it.
1°/ Create a simple field 'role ' in DB, a middleware to check for isAdmin and maybe to prefix routes to have something like https://myapp/admin and https://myapp/member
For this solution I plan to regroup the Admin and User controllers in separate folders (Controllers\Admin and Controllers\Users) and also make specific models for each role. I don't know if it's effective.
Also I plan to have separate views and routes since I like to have separations.
My question is to know if it's effective and maintanable. (will have a lot of file)
And what about the routes and redirect after login based on the role ?
2°/ create a second app with shared DB and use subdomains
3°/ another idea ?
I'd like to have a clear view about those 2 separate spaces and be able to work indepedently
thanks all !