Skip to content

Commit

Permalink
[Feature] make dynamic routes from config #1
Browse files Browse the repository at this point in the history
  • Loading branch information
3x1io committed Jul 8, 2024
1 parent 5990e07 commit 4cec435
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion config/filament-developer-gate.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
return [
"password" => env("DEVELOPER_GATE_PASSWORD", "password"),

"redirect" => env("DEVELOPER_GATE_REDIRECT", "/admin")
"redirect" => env("DEVELOPER_GATE_REDIRECT", "/admin"),

"route_prefix" => "admin"
];
6 changes: 3 additions & 3 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use Illuminate\Support\Facades\Route;

Route::middleware('web')->group(function (){
Route::post('/admin/{tenent}/developer-gate', [TomatoPHP\FilamentDeveloperGate\Http\Controllers\DeveloperGateController::class, 'login'])->name('developer-gate.login.tenent');
Route::post('/admin/developer-gate', [TomatoPHP\FilamentDeveloperGate\Http\Controllers\DeveloperGateController::class, 'login'])->name('developer-gate.login');
Route::middleware('web')->prefix(config('filament-developer-gate.route_prefix'))->group(function (){
Route::post('/{tenent}/developer-gate', [TomatoPHP\FilamentDeveloperGate\Http\Controllers\DeveloperGateController::class, 'login'])->name('developer-gate.login.tenent');
Route::post('/developer-gate', [TomatoPHP\FilamentDeveloperGate\Http\Controllers\DeveloperGateController::class, 'login'])->name('developer-gate.login');
});

0 comments on commit 4cec435

Please sign in to comment.