/home/techb158/ileadtechnology.com/app/Http/Middleware
Edit: /home/techb158/ileadtechnology.com/app/Http/Middleware/MaintananceMode.php (1435B)
ip();
$comingsoon = ComingSoon::first();
$ip_address = array();
if(is_array($comingsoon['allowed_ip']) || is_object($comingsoon['allowed_ip']))
{
foreach($comingsoon->allowed_ip as $b)
{
array_push($ip_address, $b);
}
}
$ip_address = array_values(array_filter($ip_address));
$ip_address = array_flatten($ip_address);
if(isset($ip_address) && in_array($ip, $ip_address))
{
return $next($request);
}
else
{
if(Auth::check() && Auth::user()->role == 'admin'){
return $next($request);
}
else{
if($comingsoon['enable'] == 1){
return redirect()->route('comingsoon.show');
}
else{
return $next($request);
}
}
}
return $next($request);
}
}