getClientIp(); $ips = Cache::rememberForever('ip_blacklist', function () { if (!file_exists(storage_path('installed'))) { return []; } return BanIp::all()->pluck('ip')->toArray(); }); if (Auth::check() && !Auth::user()->isSuperAdmin()) { if (in_array($ip, $ips)) { abort('403'); return false; } } return $next($request); } }