Add the CorsMiddleware to the bootstrap/app.php
$app->middleware([
App\Http\Middleware\CorsMiddleware::class
]);
or
$app->routeMiddleware([
'cors' => App\Http\Middleware\CorsMiddleware::class
]);
can solved
OPTIONS http:// 405 (Method Not Allowed)
XMLHttpRequest cannot load http://. Response for preflight has invalid HTTP status code 405