diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index fc54de4..e641aec 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -21,6 +21,7 @@ class Kernel extends HttpKernel \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, \App\Http\Middleware\TrimStrings::class, \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, + \Fruitcake\Cors\HandleCors::class, ]; /** @@ -42,7 +43,6 @@ class Kernel extends HttpKernel // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, 'throttle:api', \Illuminate\Routing\Middleware\SubstituteBindings::class, - \App\Http\Middleware\AllowCors::class, ], ]; diff --git a/composer.json b/composer.json index 781caeb..424daee 100644 --- a/composer.json +++ b/composer.json @@ -10,6 +10,7 @@ "require": { "php": "^8.0.2", "doctrine/dbal": "^3.4", + "fruitcake/laravel-cors": "^3.0", "genealabs/laravel-model-caching": "^0.12.5", "guzzlehttp/guzzle": "^7.2", "jenssegers/mongodb": "^3.9", diff --git a/config/cors.php b/config/cors.php index 8a39e6d..51f16e8 100644 --- a/config/cors.php +++ b/config/cors.php @@ -27,8 +27,8 @@ 'exposed_headers' => [], - 'max_age' => 0, + 'max_age' => 86400, - 'supports_credentials' => false, + 'supports_credentials' => true, ]; diff --git a/config/database.php b/config/database.php index af35775..5d01263 100644 --- a/config/database.php +++ b/config/database.php @@ -114,7 +114,7 @@ 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'), + 'prefix' => env('REDIS_PREFIX', 'laecloud_database_'), ], 'default' => [