Created
July 21, 2020 13:30
-
-
Save elishaukpong/f7b7ae2df1b9f0b6d9573a4c7f2a24aa to your computer and use it in GitHub Desktop.
Bring the application out of maintenance mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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