From 707517bc390f3d0d21a8229a8e6bbccbf52166b3 Mon Sep 17 00:00:00 2001 From: boban Date: Sun, 19 Apr 2026 01:04:46 +0200 Subject: [PATCH] Add: CORS config for all environments --- src/config/cors.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/config/cors.php diff --git a/src/config/cors.php b/src/config/cors.php new file mode 100644 index 0000000..5406a06 --- /dev/null +++ b/src/config/cors.php @@ -0,0 +1,32 @@ + ['api/*', 'v1/*'], + + 'allowed_methods' => ['*'], + + 'allowed_origins' => [ + env('APP_URL', 'http://localhost'), + env('APP_CONNECT_URL', 'http://localhost'), + // Lokal: + 'http://app.aziros.local', + 'http://api.aziros.local', + // Staging: + 'https://app.staging.aziros.com', + // Production: + 'https://app.aziros.com', + 'https://www.aziros.com', + ], + + 'allowed_origins_patterns' => [ + '#^https?://.*\.aziros\.(com|local)$#', + ], + + 'allowed_headers' => ['*'], + + 'exposed_headers' => [], + + 'max_age' => 0, + + 'supports_credentials' => true, +];