Send route param to middleware as argument Laravel

蓝咒 提交于 2019-12-11 03:23:53

问题


Can I sent to middleware parameter from router as argument?

For simple:

Route::get('test/{param}',['middleware'=>['testing:{param}'],'uses'=>'TestController@method']);

Is there in Laravel isset method like this? I know about Route::current()->parameters() but I want to find better method.


回答1:


I ask Laravel's team on GitHub about it. They answered that now any method like this not exists. They answer that I should use $request->route().

Enjoy!



来源:https://stackoverflow.com/questions/32082758/send-route-param-to-middleware-as-argument-laravel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!