From e5bc2cbe38de2a5a56cac065405cf50bd67537df Mon Sep 17 00:00:00 2001 From: ncoronel Date: Thu, 2 Jul 2026 09:49:29 -0300 Subject: [PATCH] feat: add CORS configuration file for handling cross-origin requests --- .env.example | 1 + config/cors.php | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 config/cors.php diff --git a/.env.example b/.env.example index 22b762f..a1a70e3 100644 --- a/.env.example +++ b/.env.example @@ -3,6 +3,7 @@ APP_ENV=local APP_KEY= APP_DEBUG=true APP_URL=http://localhost +FRONTEND_URL=http://localhost:4200 APP_LOCALE=en APP_FALLBACK_LOCALE=en diff --git a/config/cors.php b/config/cors.php new file mode 100644 index 0000000..392a9d3 --- /dev/null +++ b/config/cors.php @@ -0,0 +1,34 @@ + ['api/*', 'sanctum/csrf-cookie'], + + 'allowed_methods' => ['*'], + + 'allowed_origins' => [env('FRONTEND_URL', 'http://localhost:4200')], + + 'allowed_origins_patterns' => [], + + 'allowed_headers' => ['*'], + + 'exposed_headers' => [], + + 'max_age' => 0, + + 'supports_credentials' => true, + +];