Hi guys.
Im having problems with CORS on laravel.
I created two dockers services.
One for the front end (axios on vuejs).
The other for laravel backend runing with sail script.
Is there same quick way to allow CORS for all methods for all routes.
Working with raw php I used to do:
header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json');
but this does not work here.
I readed about cors file , so I did:
´´´
return [
/*
|--------------------------------------------------------------------------
| Cross-Origin Resource Sharing (CORS) Configuration
|--------------------------------------------------------------------------
|
*/
'paths' => ['api/*', 'sanctum/csrf-cookie', '/*'],
'allowed_methods' => ['*'],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => false,
];
´´´
but can not fire axios get request with single param.
Any help would be wellcome.
Thanks!!!