I have a Vue.js SPA being served by a Laravel backend. Both are separate projects. I am using fruitcake to handle CORS but I keep getting this error:
Access to XMLHttpRequest at 'http://domain.test/api/v1/attributes/3' from origin 'http://localhost:8081' has been blocked by CORS policy: Method PUT is not allowed by Access-Control-Allow-Methods in preflight response. GET, POST methods work fine.
I have tried the solutions from similar problems here but none seem to work. I have even tried creating my own middleware like suggested here. Here is my config/cors.php that I am using with fruitcake.
'paths' => [], 'allowed_methods' => ['*'], 'allowed_origins' => ['*'], 'allowed_origins_patterns' => [], 'allowed_headers' => ['*'], 'exposed_headers' => [], 'max_age' => 0, 'supports_credentials' => true,
I had assumed that 'allowed_methods' => ['*'], means all requests will be allowed. Anyone knows why?