This commit is contained in:
2026-01-31 17:26:20 +01:00
parent 637a32314a
commit fadaf6765c
3 changed files with 7 additions and 9 deletions
+4
View File
@@ -3,6 +3,7 @@
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Http\Middleware\HandleCors;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
@@ -14,6 +15,9 @@ return Application::configure(basePath: dirname(__DIR__))
)
->withMiddleware(function (Middleware $middleware): void {
$middleware->statefulApi();
$middleware->api(prepend: [
HandleCors::class,
]);
})
->withExceptions(function (Exceptions $exceptions): void {
//
-5
View File
@@ -123,9 +123,4 @@ return [
'store' => env('APP_MAINTENANCE_STORE', 'database'),
],
'frontend' => [
'dev' => env('DEV', false),
'dev_url' => env('FRONTEND_DEV_URL', 'http://localhost:5173'),
],
];
+3 -4
View File
@@ -19,10 +19,9 @@ return [
'allowed_methods' => ['*'],
'allowed_origins' => config('app.frontend.dev')
? [config('app.frontend.dev_url')]
: ['*'],
'allowed_origins' => env('DEV', false)
? ['http://localhost:5173', 'http://localhost:5174', 'http://localhost', 'http://localhost:80']
: [env('APP_URL', 'http://localhost')],
'allowed_origins_patterns' => [],