看到laravel AuthServiceProvider功能https://laravel.com/docs/5.1/authorization,我需要根据用户权限过滤路由,例如:
Route::group(['middleware' => 'can','action'="user.admin"], function () {
Route::any('/', ['as' => 'user.index', 'uses' => 'UserController@index']);
Route::any('{id}', ['as' => 'user.show', 'uses' => 'UserController@show']);
});
怎么做?