Laravel 4 - Child constructor call parent constructor with dependency injection

后端 未结 6 1814
死守一世寂寞
死守一世寂寞 2021-02-05 02:53

I\'m building a CMS using Laravel 4 and I have a base admin controller for the admin pages that looks something like this:

class AdminController extends BaseCont         


        
6条回答
  •  有刺的猬
    2021-02-05 03:28

    You must pass the dependencies to the parent constructor to have them available in the child. There is no way to inject the dependencies on the parent construct when you instantiate it via the child.

提交回复
热议问题