for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Schnittstabil\Dartisan\Commands;
use Garden\Cli\Cli;
use Garden\Cli\Args;
use Illuminate\Database\Migrations\MigrationRepositoryInterface;
class MigrateInstallCommand extends Command
{
use DatabaseAwareCommandTrait;
use MigrationAwareCommandTrait;
public static $name = 'migrate:install';
protected $args;
protected $repository;
public function __construct(callable $outputFormatter, Args $args, MigrationRepositoryInterface $repository)
parent::__construct($outputFormatter);
$this->args = $args;
$this->repository = $repository;
}
public function run()
if ($this->repository->repositoryExists()) {
$this->echoInfo('Migration table already exists.');
return 0;
$this->repository->createRepository();
$this->echoInfo('Migration table created successfully.');
public static function register(Cli $cli)
$cli = static::registerDatabaseOpts($cli);
$cli = static::registerMigrationOpts($cli);
return $cli
->command(static::$name)
->description('Create the migration repository.');