mardi 6 novembre 2018

Global variable in all templates Laravel?

I was authorized under user and object Auth::user() is not empty. So using this object and relations between models therefore I can get status of user from Users table:

$profileStatus = Auth::user()->user->first()->status;

How to share this variable $profileStatus in all template in Laravel to show/hide HTML blocks depend this value (active/not active)?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire