mercredi 26 août 2015

laravel 5 - Share a variable across controllers (without rendering a view)

I have a small application developed with Laravel, and I would like to share a variable (a result from a remote service, cached ) across all the controllers.

I read about ViewComposer, but they only work is a view is rendered (makes sense), and my app has many json responses.

I know that I could traditionally extend my controllers from a BaseController, but I wonder if anybody knows a way to do that without relying on inheritance.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1LwerCU
via IFTTT

Aucun commentaire:

Enregistrer un commentaire