$request['company'] = $company;
Oct 3, 2017
10
Level 1
Request attributes
In Laravel 5.1 in middleware I add custom attribute to request
$request->attributes->add(['company' => $company]);
And in Controller.php i have acces this with following code
use Illuminate\Http\Request;
public function __construct(Request $request) {
$company = $request->get('company');
}
But now in Laravel 5.5 this not work anymore, any suggestions?
Level 1
Okay I change style work, get help from this question: https://laracasts.com/discuss/channels/general-discussion/pass-data-from-middleware-to-controllers.
Please or to participate in this conversation.