Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Laravel 5 bindings not initialising on first request, subsequent requests okay. #3728
Laravel 5 module isn't allowing the IoC bindings introduced in version 2.2.2 to be bound for the first request. I've tracked this down to the logic in the __construct / doRequest of Laravel5.php.
On construct it's initialised, during which the bindings are applied as part of initialise
This means that automatically, on the first request there can never be any bindings set at all due to this piece of code :
So to confirm, here's the flow of a typical test pseudo style
After dumping some debug around the code :
So for my work around to this I'll need to make a request to some page which doesn't require the IoC binding and then follow through with the proper requests.
Let me know if you need a test project supplied, however the logic for this issue is fairly straight forward unless I've missed something glaringly obvious.