Laravel-Backpack / basset

Better asset helpers for Laravel apps.
MIT License
155 stars 11 forks source link

Load BassetManager via Scoped Singleton to resolve Octane issues #105

Closed alruddick closed 10 months ago

alruddick commented 10 months ago

As highlighted in this issue, using the Octane runtime causes assets not to load after the first request

https://github.com/Laravel-Backpack/basset/issues/102

Binding using a singleton when using Octane can cause problems across requests. Binding using a scoped singleton will resolve this behaviour on Octane but won't negatively affect php-fpm users

See Laravel Docs:

https://laravel.com/docs/10.x/container#binding-scoped

pxpm commented 10 months ago

@promatik just lost the opportunity to merge this. I was in a meeting with him yesterday and was reviewing the basset issues and we hit on this one. We were sharing the screen and I told him: yeah, just change it to scoped and you can merge and Commit right way. He decided to wait for testing, too bad, I am sure it works 🙃 We live on the edge. EXtrem programming. Yeah. Merging without testing, just because I am loose than @promatik

Thanks @alruddick