Asier Devdream Asier Devdream - 8 months ago 43
PHP Question

Add method for all controllers Laravel

I have a layout where the footer is common for all sections. That footer has to make different methods but I do not know how to implement in all controllers at once.

I thought I could implement the constructor in the

, but I think that is a bad idea.


Here is how I would do this... you're simply extending BaseController and calling it BadassController, then extending that in your controllers.

class BadassController extends BaseController {}