invoiceninja/app/Console/Commands/ResetData.php

35 lines
585 B
PHP
Raw Normal View History

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