configured cors for local development

This commit is contained in:
2024-07-14 10:50:02 +00:00
parent 18c711686c
commit 5afc3c916b
3 changed files with 22 additions and 9 deletions

View File

@@ -60,18 +60,27 @@ class RouteServiceProvider extends ServiceProvider
{
Route::middleware('web')
// ->middleware('confirmUser')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
->namespace($this->namespace)
->group(base_path('routes/web.php'));
Route::prefix('v2')
->middleware('web', 'auth', 'confirmUser')
->namespace($this->namespace)
->group(base_path('routes/v2.php'));
Route::prefix('api/v3')
->name('v3')
->middleware('web', 'auth', 'confirmUser')
->namespace($this->namespace)
->group(base_path('routes/v3.php'));
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
Route::prefix('RandD')
->middleware('web', 'auth', 'confirmUser', 'randd')
->namespace($this->namespace)
->group(base_path('routes/randd.php'));
->group(base_path('routes/randd.php'));
}
/**
@@ -83,9 +92,6 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}
}

View File

@@ -180,6 +180,10 @@ return [
App\Providers\RouteServiceProvider::class,
App\Providers\TelescopeServiceProvider::class,
Barryvdh\Debugbar\ServiceProvider::class,
// custom facades here..
App\Providers\DataTableServiceProvider::class,
],
/*

View File

@@ -1,5 +1,7 @@
<?php
$allowed_origins = env('IS_DEVELOPMENT_ENV') ? ['*'] : ['https://rms.rmto.ir'];
return [
/*
@@ -32,7 +34,8 @@ return [
/*
* Matches the request origin. `[*]` allows all origins.
*/
'allowed_origins' => ['*'],
// 'allowed_origins' => ['*'],
'allowed_origins' => $allowed_origins,
/*
* Matches the request origin with, similar to `Request::is()`