@vincent15000 For me I like second way because I don't like to write separate view, controller etc. :)
Several roles and code organization
Hello,
I work on an app with several roles and it begins to be quite confusing for me, quite complex to go further in new functionalities.
For example I need to display some informations for the admin (training details, trainers, units, courses, calendar), and some other informations for the trainer (courses, calendar, and not the training details, trainers and units). Furthermore the admin can edit all these informations and the trainer has only access to them in readonly mode.
What is the best way to display these informations according to the role of the connected user ?
-
have two different views and for example the admin accesses the view via /admin/training/6 and the trainer via /trainer/training/6 ? that also means to have specific training controllers (one for the admin and another for the trainer)
-
have the same view and hide some elements that should not be visible for the trainer, that also means to have only one controller for the trainings and that the controller doesn't send the datas for the hidden parts of the view
I tried to take in account some advice for example in different videos on laracast which advise to refactor the code, but I wonder if in my case it would not be more convenient to have real separate views and controllers.
What do you suggest me ?
Thanks a lot ;).
V
Please or to participate in this conversation.