Skip to content

Commit 641a59b

Browse files
committed
🔧 ajout des routes du cpanel
1 parent c80462c commit 641a59b

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

app/Http/Kernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,6 @@ class Kernel extends HttpKernel
6363
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
6464
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
6565
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
66+
'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class,
6667
];
6768
}

app/Providers/RouteServiceProvider.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ public function boot()
4848
Route::middleware('web')
4949
->namespace($this->namespace)
5050
->group(base_path('routes/web.php'));
51+
52+
Route::middleware(['web', 'auth', 'role:moderator|admin'])
53+
->namespace($this->namespace)
54+
->prefix('cpanel')
55+
->as('cpanel.')
56+
->group(base_path('routes/cpanel.php'));
5157
});
5258

5359
Route::macro('redirectMap', function ($map, $status = 302) {

routes/cpanel.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
use App\Http\Controllers\Cpanel\DashboardController;
4+
use Illuminate\Support\Facades\Route;
5+
6+
Route::redirect('/', 'cpanel/home');
7+
Route::get('/home', [DashboardController::class, 'home'])->name('home');

0 commit comments

Comments
 (0)