Skip to content

Instantly share code, notes, and snippets.

@elishaukpong
Created July 21, 2020 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elishaukpong/f7b7ae2df1b9f0b6d9573a4c7f2a24aa to your computer and use it in GitHub Desktop.
Save elishaukpong/f7b7ae2df1b9f0b6d9573a4c7f2a24aa to your computer and use it in GitHub Desktop.
Bring the application out of maintenance mode
<?php
namespace Illuminate\Foundation\Console;
use Exception;
use Illuminate\Console\Command;
class UpCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'up';
/**
* The console command description.
*
* @var string
*/
protected $description = '<?php
namespace Illuminate\Foundation\Console;
use Exception;
use Illuminate\Console\Command;
class UpCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'up';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Bring the application out of maintenance mode';
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
try {
if (! file_exists(storage_path('framework/down'))) {
$this->comment('Application is already up.');
return true;
}
unlink(storage_path('framework/down'));
$this->info('Application is now live.');
} catch (Exception $e) {
$this->error('Failed to disable maintenance mode.');
$this->error($e->getMessage());
return 1;
}
}
}
';
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
try {
if (! file_exists(storage_path('framework/down'))) {
$this->comment('Application is already up.');
return true;
}
unlink(storage_path('framework/down'));
$this->info('Application is now live.');
} catch (Exception $e) {
$this->error('Failed to disable maintenance mode.');
$this->error($e->getMessage());
return 1;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment