Installed fruitcake/laravel-cors on Laravel 5.8
My testserver uses php artisan serve on 127.0.0.1:8000 using routes/api.php client (nuxt) is running on 127.0.0.1:3000
I'm able to send data to the server using the POSTMAN tool
I've configured fruitcake/laravel-cors
protected $middleware = [
// ...
\Fruitcake\Cors\HandleCors::class,
];
and config/cors.php
<?php
return [
/*
* You can enable CORS for 1 or multiple paths.
* Example: ['api/*']
*/
'paths' => [],
/*
* Matches the request method. `[*]` allows all methods.
*/
'allowed_methods' => ['*'],
/*
* Matches the request origin. `[*]` allows all origins.
*/
'allowed_origins' => ['*'],
/*
* Matches the request origin with, similar to `Request::is()`
*/
'allowed_origins_patterns' => [],
/*
* Sets the Access-Control-Allow-Headers response header. `[*]` allows all headers.
*/
'allowed_headers' => ['*'],
/*
* Sets the Access-Control-Expose-Headers response header.
*/
'exposed_headers' => false,
/*
* Sets the Access-Control-Max-Age response header.
*/
'max_age' => false,
/*
* Sets the Access-Control-Allow-Credentials header.
*/
'supports_credentials' => false,
];
Still getting:
Access to XMLHttpRequest at 'http://127.0.0.1:8000/api/customerFeedbackStore' from origin 'http://127.0.0.1:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
in browser.
'paths' => ['api/*']