is_admin) { return $next($request); } if (Auth::check() && Auth::user()->is_tab) { return $next($request); } return redirect('dashboard')->with('error', 'You are not authorized to perform this action'); } }