Support the ongoing development of Laravel.io →
posted 10 years ago
Requests
Last updated 1 year 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 1 year ago.
0

Sign in to participate in this thread!

Eventy

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.

© 2024 Laravel.io - All rights reserved.