PM_Console/backend/config/cors.php

19 خطوط
582 B
PHP

<?php
$frontendUrl = env('FRONTEND_URL');
return [
'paths' => ['api/*', 'sanctum/csrf-cookie'],
'allowed_methods' => ['*'],
'allowed_origins' => array_values(array_filter([
$frontendUrl,
env('APP_ENV') === 'local' ? 'http://localhost:4004' : null,
env('APP_ENV') === 'local' ? 'http://127.0.0.1:4004' : null,
])),
'allowed_origins_patterns' => [],
'allowed_headers' => ['Content-Type', 'X-Requested-With', 'Authorization', 'Accept', 'Origin'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => true,
];