mercredi 27 novembre 2019

Global variable in laravel 5.5

I'm new to laravel and currently making a dashboard with laravel and stuck on how to store variable that can be accessed by all view and controller and can be changed by controller. For example i'm logging in into the dashboard and i want to store the query i got from the database .

$admin = DB::table('admin')->where('username',$request->user)->select('admin_name')->first();

After that i want $admin to be stored globally so all the view and controller can use it. I've tried session but it doesn't work and always return null value. Any anybody tell me another solution ?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2R69bkT
via IFTTT

Aucun commentaire:

Enregistrer un commentaire