1Route::group(['middleware' => 'checkUserLevel:some_value_of_level'], function () {
2 // my routes
3 });
4
1public function handle($request, Closure $next, $level)
2{
3 $user = Auth::user();
4 if ($user->level > $level) {
5 return redirect('testUrl');
6 }
7
8 return $next($request);
9}
10