for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PWWEB\Artomator\Commands\Common;
use InfyOm\Generator\Generators\MigrationGenerator;
use PWWEB\Artomator\Commands\BaseCommand;
use PWWEB\Artomator\Common\CommandData;
class MigrationGeneratorCommand extends BaseCommand
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'artomator:migration';
* The console command description.
protected $description = 'Create migration command';
* Create a new command instance.
public function __construct()
parent::__construct();
$this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);
}
* Execute the command.
* @return void
public function handle()
parent::handle();
if ($this->commandData->getOption('fromTable')) {
$this->error('fromTable option is not allowed to use with migration generator');
return;
$migrationGenerator = new MigrationGenerator($this->commandData);
$migrationGenerator->generate();
$this->performPostActionsWithMigration();
* Get the console command options.
* @return array
public function getOptions()
return array_merge(parent::getOptions(), []);
* Get the console command arguments.
protected function getArguments()
return array_merge(parent::getArguments(), []);