📜  laravel 排除中间件或从路由中删除中间件 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:37.693000             🧑  作者: Mango

代码示例1
use App\Http\Middleware\EnsureTokenIsValid;

Route::middleware([EnsureTokenIsValid::class])->group(function () {
    Route::get('/', function () {
        //
    });

    Route::get('/profile', function () {
        //
    })->withoutMiddleware([EnsureTokenIsValid::class]);
});