diff --git a/config/backpack/base.php b/config/backpack/base.php index 26b8579..6d600c0 100644 --- a/config/backpack/base.php +++ b/config/backpack/base.php @@ -24,7 +24,7 @@ return [ // The prefix used in all base routes (the 'admin' in admin/dashboard) // You can make sure all your URLs use this prefix by using the backpack_url() helper instead of url() - 'route_prefix' => 'admin', + 'route_prefix' => '', // The web middleware (group) used in all base & CRUD routes // If you've modified your "web" middleware group (ex: removed sessions), you can use a different diff --git a/routes/backpack/custom.php b/routes/backpack/custom.php index dc8c4bc..9acb959 100644 --- a/routes/backpack/custom.php +++ b/routes/backpack/custom.php @@ -9,6 +9,7 @@ use Illuminate\Support\Facades\Route; // Routes you generate using Backpack\Generators will be placed here. Route::group([ + 'domain' => env('APP_ENV') == 'local' ? 'admin.namaka.loc' : 'admin.namaka.ir', 'prefix' => config('backpack.base.route_prefix', 'admin'), 'middleware' => array_merge( (array) config('backpack.base.web_middleware', 'web'), diff --git a/routes/web.php b/routes/web.php index e298195..5ab5e6b 100644 --- a/routes/web.php +++ b/routes/web.php @@ -2,21 +2,10 @@ use Illuminate\Support\Facades\Route; -Route::domain('{domain}')->group(function (){ - Route::get('/', [ - \App\Http\Controllers\MenuController::class, - 'index' - ]); -}); -Route::domain('{username}.test.loc')->group(function () { - Route::get('/', [ +Route::domain(env('APP_ENV') == 'local' ? 'localhost' : 'namaka.ir')->group(function () { + Route::get('/{username}', [ \App\Http\Controllers\MenuController::class, 'index' ]); }); - -Route::get('/', [ - \App\Http\Controllers\MenuController::class, - 'index' -]);