Support the ongoing development of Laravel.io →
posted 8 years ago
Requests
Last updated 7 months ago.
0

I just did a quick test and it really looks like the execution flow is like

  • __construct() in child class/YourController.php
  • execute any action inside __construct() in child class/YourController.php
  • __construct() in parent class/BaseController.php
  • execute the beforeFilter from __construct() in parent class/BaseController.php
  • execute method in YourController.php given by route e.g. getIndex()

So the beforeFilter gets executed after the child constructor.

Don't know if this behaviour is implied.

Maybe someone with more knowledge of the inner workings in Laravel can say something to this.

Last updated 7 months ago.
0

Sign in to participate in this thread!

LaraJobs

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.