php - Laravel5 passing route args as middleware args -
i route argument passed middleware argument, this
route::get('foo/{id}', ['middleware' => 'bar:{id}', function(){ }); how this?
you can request variable:
route::get('foo/{id}', ['middleware' => 'bar', function(){ }); public function handle($request, closure $next) { $id = $request->id; } the
bar:id is used when want pass string id middleware.
Comments
Post a Comment