Answer the question
In order to leave comments, you need to log in
How to access session from service provider in laravel?
How to access session from service provider in laravel?
Get the $orders variable in the header.
There is a session in the files, but in the AppServiceProvider
dd(session('item')) = null.
public function boot()
{
$orders = Order::where('id',session('item'))->first();
View::share([
'orders'=> $orders,
]);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question