手动检查Laravel中间件是否通过

时间:2016-10-23 15:38:42

标签: php laravel-5 laravel-middleware

假设我有2条路线:

Route::get('/viewfile', 'FileController@view');

// second route has 2 middlewares which could be anything else (dynamic)
Route::get('/upload', [
    'middleware' => ['auth', 'upload'], 
    'uses' => 'FileController@upload'
]);

现在,当用户(或访问者)访问/viewfile时,需要检查它是否也能够通过分配到/upload路由的所有中间件。

换句话说,如何检查/upload路线是否也可以访问?

0 个答案:

没有答案