Support the ongoing development of →
Requests Session Database
Last updated 3 months ago.

In 5.1 version you can also resolve a service directly from Blade: (see section "Resolve a service from blade")


thank you for your replies, it seems that i've to read a lot to understand everything ! cuz still new. Thanks again for your efforts.


i solved it using View Composer as you told me, but i've another question if possible :$ now this method is for passing variables to all views or some, is there such a thing but for classes , or Controllers ? so i don't have to include and fetch in each controller.

Thanx a lot


My first thought is having a "Base" or "App" controller, and then having your controllers you want to have the classes/included extend the Base/App controller. Laravel has one that you could build upon (the example there is for Laravel 5) or you can make your own.

If I'm misunderstanding, please let me know.

Last updated 7 years ago.

well i think this might help, i will try it :) thnx a lot


You're welcome!


Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 - All rights reserved.