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 ?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire