IMO, the cleanest approach is a separate controller either named AdminMeetingController, or (better in my opinion) a Admin\MeetingController. This allows you and other developers (including future you) to immediately understand the context for the intended action(s). In addition, it allows you to stick to CRUD actions in both controllers.
Having Two Controller for the same resource
Hello everyone I have a question regarding best practices when it comes to controllers.
I have a Meeting model that a user can create when they book a meeting, also an admin can create a meeting for someone in the system. I have a MettingsController with a create and store method for creating a meeting but I use this for when a user books a meeting. Now when an admin creates a meeting I need to pass different inputs such as user id, type of security which for the user is set to a default value. I guess my question is: Is it better to have two controllers 1. MeetingController 2. AdminMeetingController so I don't clutter the MeetingController with if statements and checking what other fields I should add.
What would be the best way in this type of case? I anticipate that in the future I will be adding more inputs for the admin side. I appreciate any suggestion or help that you guys will provide.
Please or to participate in this conversation.