mercredi 25 novembre 2015

Laravel - Session variable is null in Service Provider

I'm trying to share a Session value with all views using AppServiceProvider class.

In the boot() function I said: view()->share('key', Session::get('key'));

But, the value is null. What can be the problem? In the Controller I'm setting it, it works fine. Even after removing the Session::put() line, the value is still in the session (obviously).



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire