I have a controller in Laravel that handles all operations of an administration panel. At the start, it was working well and all was organized. As I elaborated on it, the controller starting growing drastically in size. For every page in my controller, I dedicate a method to handle the action. Now, my controller is over 1,000 lines and being harder and harder each day to add or edit something. I would like to see the possible ways I can split up this controller into parts, and store these parts like:
controllers/
admin/
page1.php
page2.php
...
AdminController.php
FooController.php
BarController.php
So I can handle each page separately, efficiently. I haven't seen any answers on previous questions on this topic.
Put your logic in models/service provider instead as makes sense.