Improve Laravel performance with this simple trick!
There are two approaches to sharing data across views in Laravel, view share and view composer. In this tuts I will give you a brief overview of both of them and more importantly what you should be careful about when using composer. Now, let's dive in.
While working for a client whose codebase had a lot of legacy code I faced an interesting challenge, I needed to change the database connection on an already instantiated query builder, and I couldn't do it the Laravel way.