Files
newznab-tmux/app/Console/Commands/UpdateNNTmuxDB.php
T
2019-03-04 11:51:01 +01:00

42 lines
851 B
PHP

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class UpdateNNTmuxDB extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'nntmux:db';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Update NNTmux database with new patches';
/**
* Create a new command instance.
*/
public function __construct()
{
parent::__construct();
}
public function handle()
{
// also prevent web access.
$this->output->writeln('<info>Updating database</info>');
if (config('app.env') !== 'production') {
$this->call('migrate');
} else {
$this->call('migrate', ['--force' => true]);
}
}
}