Currently i am using Laravel5. My question is if if i use the Maintenance mode with
php artisan down
how can say \"the application is down for
Create new middleware
app = $app;
$this->request = $request;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if ($this->app->isDownForMaintenance() &&
!in_array($this->request->getClientIp(), ['::1']))
{
throw new HttpException(503);
}
return $next($request);
}
}
The '::1' is your own IP assuming your in localhost, if not the specify your IP. You can excluded multiple IP in the array. check Excluding your IP Address in Maintenance Mode (php artisan down) in Laravel 5