Skip to content

Commit

Permalink
feat: add MultiUi authentication routes for user namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
bdsumon4u committed Feb 21, 2025
1 parent f24417e commit 44757e4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
3 changes: 1 addition & 2 deletions bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
Expand All @@ -26,7 +25,7 @@
'auth' => Authenticate::class,
'guest' => RedirectIfAuthenticated::class,
])
->validateCsrfTokens(except: ['*']);
->validateCsrfTokens(except: ['*']);
})
->withExceptions(function (Exceptions $exceptions) {
$exceptions->render(function (NotFoundHttpException $e, Request $request) {
Expand Down
25 changes: 25 additions & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use App\Http\Controllers\ProductController;
use App\Http\Middleware\GoogleTagManagerMiddleware;
use Combindma\FacebookPixel\MetaPixelMiddleware;
use Hotash\LaravelMultiUi\Facades\MultiUi;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Session;

Expand All @@ -25,6 +26,30 @@
Route::middleware([GoogleTagManagerMiddleware::class, MetaPixelMiddleware::class])->group(function (): void {
Route::get('auth', 'App\\Http\\Controllers\\User\\Auth\\LoginController@showLoginForm')->middleware('guest:user')->name('auth');

Route::group(['as' => 'user.'], function (): void {

Route::namespace('App\\Http\\Controllers\\User')->group(function (): void {
// Admin Level Namespace & No Prefix
MultiUi::routes([
'register' => false,
'URLs' => [
'login' => 'login',
'register' => 'register',
'reset/password' => 'reset-pass',
'logout' => 'logout',
],
'prefix' => [
'URL' => 'user-',
'except' => ['login', 'register'],
],
]);
//...
//...
Route::post('resend-otp', 'Auth\LoginController@resendOTP')->name('resend-otp');
});

});

Route::get('/categories', [ApiController::class, 'categories'])->name('categories');
Route::get('/brands', [ApiController::class, 'brands'])->name('brands');

Expand Down

0 comments on commit 44757e4

Please sign in to comment.