Here in this article, I show how we can use view composer in laravel to bind data to views and not make database queries in our views. Separate your presentation logic from database interaction and instead use laravel view composer to beautifully handle them.

laravel view composers