Open szepeviktor opened 6 years ago
What's the use case for this?
You can visit the app in the browser and see pretty clearly that the app is down. If you're using a monitoring service, it should be able to detect the 503 being returned when the application is in maintenance mode.
Thank you.
You can visit the app in the browser
I am a stay-at-the-terminal type.
And in script it is necessary to check for maintenance mode.
You can check $this->app->isDownForMaintenance()
in your commands.
Thanks.
$ ./artisan isdown
ErrorException : Undefined property: App\Console\Commands\IsDownForMaintenance::$app
at app/Console/Commands/IsDownForMaintenance.php:40
36| * @return mixed
37| */
38| public function handle()
39| {
> 40| if (!$this->app->isDownForMaintenance()) {
41| $this->info('Application is up.');
42| return;
43| }
44|
Exception trace:
1 Raven_Breadcrumbs_ErrorHandler::handleError("Undefined property: App\Console\Commands\IsDownForMaintenance::$app", "app/Console/Commands/IsDownForMaintenance.php", [])
app/Console/Commands/IsDownForMaintenance.php:40
2 App\Console\Commands\IsDownForMaintenance::handle()
/home/viktor/src/gallerytool/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29
It's $this->laravel
, not $this->app
.
In a script, you could also simply check if storage/framework/down exists. If that file exists, the application is currently down.
Thank you. That is OK.
When Laravel is down it would be nice to figure out its current state.
Could you add an
isdown
command?https://github.com/laravel/framework/issues/25721