Asier Devdream Asier Devdream - 1 year ago 114
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.

Answer Source

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 {}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download