Skip to content

Instantly share code, notes, and snippets.

@joycse06
Last active August 29, 2015 14:10
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 joycse06/c03da3aaa31e416cfb0f to your computer and use it in GitHub Desktop.
Save joycse06/c03da3aaa31e416cfb0f to your computer and use it in GitHub Desktop.
Artisan Startover Command
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class StartOverCommand extends Command {
/**
* The console command name.
*
* @var string
*/
protected $name = 'appname:startover';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Reset Migration, remigrate, seed data and Start Over';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function fire()
{
$this->info("Resetting the Migration.....");
$this->call('migrate:reset');
$this->info("Recreating schemas....");
$this->call('migrate');
$this->info('Seeding data.....');
$this->call('db:seed');
}
/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return array(
);
}
/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return array(
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment