barryvdh/laravel-cors not working for my routes
问题 I'm using [this laravel-cors package][1], I've read the docs and I've added the service provider to config/app.php . After adding the middleware to kernel.php like so: protected $middleware = [ \Barryvdh\Cors\HandleCors::class, \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class, ]; It works for my passport routes, but not for my own routes. Passport routes Route::group([ 'middleware' => ['api'] ], function ($router) { Passport::routes(); Passport::tokensExpireIn(Carbon::now