The task is the following: I want to transfer to all controllers the data about the site header, which I receive from the database. How can I do it?
I tried it like this, but it seems to be quite different:
public function handle($request, Closure $next) { $arr = ['a' => 'b', 'c' => 'd']; $request->request->set('first', $arr); return $next($request); } And then in the controller I try to address them like this:
public function getIndex(Request $request) { dd($request->request->get('first')); } Who knows the thread how to do it right?