Upon first pass, I thought the same thing. Then I remembered how inheritance works. Effectively, when you inherit from a class, you get the parents properties and methods automatically. However, when you override these properties or methods you are providing your own manual implementation. The exception being you can explicitly call parent
.
So, in your case, you have two options:
FlightController
constructor is exactly the same as DashboardController
, then don't override __construct
in FlightController
and it will work as expected as it will automatically use __construct
in DashboardController
.FlightController
constructor you can use parent::__constructor()
to invoke the DashboardController
constructor so you don't need to repeat/copy its logic (i.e. middleware).Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community