email); } if (Auth::check() && Auth::user()->role === $role) { return $next($request); } return redirect('/home')->with('error', 'You do not have access to this page.'); } }