src/Console/MigrateFreshCommand.php
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $migrate = Migrate::new($input->getOption('dsn'), $input->getOption('path'), $output);

        $files = $migrate->getMigrator()->getMigrationFiles(M::TYPE_UP);
        $migrate->drop();

        if (count($files) < 1) {
            $output->writeln('');
            $output->writeln('<comment>Migration files not found</comment>');
            return;
        }

        $migrate
            ->install()
            ->run()
            ->close();

        if ($input->getOption('seed')) {
            $this->getSeed($input, $output)
                 ->run()
                 ->close();
        }

        $output->writeln('');
        $output->writeln('<comment>Completed.</comment>');
    }
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $migrate = Migrate::new($input->getOption('dsn'), $input->getOption('path'), $output);

        $files = $migrate->getMigrator()->getMigrationFiles(M::TYPE_UP);
        $migrate->drop();

        if (count($files) < 1) {
            $output->writeln('');
            $output->writeln('<comment>Migration files not found</comment>');
            return;
        }

        $migrate
            ->install()
            ->run()
            ->close();

        if ($input->getOption('seed')) {
            $this->getSeed($input, $output)
                 ->run()
                 ->close();
        }

        $output->writeln('');
        $output->writeln('<comment>Completed.</comment>');
    }
Execute command, captain.

@param \Symfony\Component\Console\Input\InputInterface $input
@param \Symfony\Component\Console\Output\OutputInterface $output
@return int|null|void
@throws \Invoker\Exception\InvocationException
@throws \Invoker\Exception\NotCallableException
@throws \Invoker\Exception\NotEnoughParametersException
@throws \League\Flysystem\FileNotFoundException