Answer the question
In order to leave comments, you need to log in
How to pass middleware parameters to laravel from controller?
is it possible to somehow pass parameters from the controller to the middleware?
Answer the question
In order to leave comments, you need to log in
Use request()
//принять в middleware
dd($request->route(null));
dd($request->input(null));
dd($request);
//передать из middleware
$request->newData = $data;
If you need to use a parameter in the intermediary that is passed to the controller from the route, then you can use the
id construct, in this case it is passed to the controller from the router
And it gets into the router out of sight{{ route('companyHome',['id'=>$company->id]) }}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question