2017-01-30 21:40:43 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Console\Commands;
|
2015-03-17 07:45:25 +10:00
|
|
|
|
|
|
|
|
use Illuminate\Console\Command;
|
2017-01-30 21:40:43 +02:00
|
|
|
use Utils;
|
2015-03-17 07:45:25 +10:00
|
|
|
|
2016-07-03 18:11:58 +02:00
|
|
|
/**
|
2017-01-30 21:40:43 +02:00
|
|
|
* Class ResetData.
|
2016-07-03 18:11:58 +02:00
|
|
|
*/
|
|
|
|
|
class ResetData extends Command
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
protected $name = 'ninja:reset-data';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
protected $description = 'Reset data';
|
2015-03-17 07:45:25 +10:00
|
|
|
|
2016-07-03 18:11:58 +02:00
|
|
|
public function fire()
|
|
|
|
|
{
|
|
|
|
|
$this->info(date('Y-m-d') . ' Running ResetData...');
|
2015-03-17 07:45:25 +10:00
|
|
|
|
2017-01-30 21:40:43 +02:00
|
|
|
if (! Utils::isNinjaDev()) {
|
2016-07-03 18:11:58 +02:00
|
|
|
return;
|
|
|
|
|
}
|
2015-03-17 07:45:25 +10:00
|
|
|
|
2016-07-03 18:11:58 +02:00
|
|
|
Artisan::call('migrate:reset');
|
|
|
|
|
Artisan::call('migrate');
|
|
|
|
|
Artisan::call('db:seed');
|
|
|
|
|
}
|
2017-01-30 18:05:31 +02:00
|
|
|
}
|