Skip to content

Commit 6cada20

Browse files
authored
Merge pull request #34 from laravelcm/cpanel
Cpanel
2 parents c80462c + ea663f5 commit 6cada20

33 files changed

+245
-78665
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Cpanel;
4+
5+
use App\Http\Controllers\Controller;
6+
7+
class DashboardController extends Controller
8+
{
9+
public function home()
10+
{
11+
return view('cpanel.dashboard');
12+
}
13+
}

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) {

0 commit comments

Comments
 (0)