Thanks to visit codestin.com
Credit goes to github.com

Skip to content

unhable to access envvar in bootstrap/app.php #55554

Answered by mbabker
mvvtf asked this question in Q&A
Discussion options

You must be logged in to vote

Would be interesting to see if the old laravel 10 way of bootstrapping the app has this issue.

It doesn't because of order of operations IIRC. I don't remember when exactly the middleware stack gets created without the use of this highly annoying application builder, but the withMiddleware() callback is run after the kernel is resolved from the container, which comes before the kernel call's the application's bootstrapWith() method with its bootstrapper list. The kernel bootstrappers include tasks such as loading the configuration, registering the core service providers, and early setup tasks like that.

So this withMiddleware() callback is going to be run at a point before the framework…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@macropay-solutions
Comment options

@mbabker
Comment options

Answer selected by mvvtf
@macropay-solutions
Comment options

@mvvtf
Comment options

@mbabker
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants