Execute the console command.

@param MenuRepositoryInterface $repository
172881
public function handle(MenuRepositoryInterface $repository)
    {
        $this->setLocale();

        $repository->ignorePermission()->initialize();

        $groups = $repository->getMenuLayout();

        if (count($groups)) {

            $this->comment('Menu layout:');
            $this->info('');

            foreach ($groups as $group) {

                $this->displaySingle($group, 1);
            }
        }
    }
1227053
public function execute(Config $config, IO $io, Repository $repository, Config\Action $action) : void
    {
        $changedPHPFiles = $repository->getIndexOperator()->getStagedFilesOfType('php');

        $io->write('linting files:', true, IO::VERBOSE);
        foreach ($changedPHPFiles as $file) {
            $io->write('  - ' . $file, true, IO::VERBOSE);
            if ($this->hasSyntaxErrors($file)) {
                throw new ActionFailed('syntax errors in file: ' . $file);
            }
        }
        $io->write('<info>No syntax errors detected</info>');
    }
157983
public function fire()
    {
        if (!$this->confirmToProceed()) {
            return;
        }

        $migrator = $this->container['migrator'];

        $migrator->setConnection($this->option('database'));

        // First, we'll make sure that the migration table actually exists before we
        // start trying to rollback and re-run all of the migrations. If it's not
        // present we'll just bail out with an info message for the developers.
        if (!$migrator->repositoryExists()) {
            return $this->comment('Migration table not found.');
        }

        $migrator->reset(
            $this->getMigrationPaths(),
            $this->option('pretend')
        );

        // Once the migrator has run we will grab the note output and send it out to
        // the console screen, since the migrator itself functions without having
        // any instances of the OutputInterface contract passed into the class.
        foreach ($migrator->getNotes() as $note) {
            $this->output->writeln($note);
        }
    }
228747
public function handle()
    {
        if (!$this->confirmToProceed()) {
            return;
        }

        $this->prepareDatabase();

        // Next, we will check to see if a path option has been defined. If it has
        // we will use the path relative to the root of this installation folder
        // so that migrations may be run for any path within the applications.
        $this->migrator->run($this->getMigrationPaths(), [
            'pretend' => $this->option('pretend'),
            'step' => $this->option('step'),
        ]);
		
        // Once the migrator has run we will grab the note output and send it out to
        // the console screen, since the migrator itself functions without having
        // any instances of the OutputInterface contract passed into the class.
        foreach ($this->getMigratorNotes() as $note) {
            $this->output->writeln($note);
        }

        // Finally, if the "seed" option has been given, we will re-run the database
        // seed task to re-populate the database, which is convenient when adding
        // a migration and a seed at the same time, as it is only this command.
        if ($this->option('seed')) {
            $this->call('db:seed', ['--force' => true]);
        }
    }
939369
public function fire()
	{
		$this->repository->setSource($this->input->getOption('database'));

		$this->repository->createRepository();

		$this->info('Migration table created successfully.');
	}
434620
private function buildMenuFromRepository($menuCode)
    {
        $menu = $this
            ->menuRepository
            ->findOneBy([
                'code' => $menuCode,
                'enabled' => true,
            ]);

        if (!($menu instanceof MenuInterface)) {
            throw new Exception(sprintf(
                'Menu "%s" not found',
                $menuCode
            ));
        }

        $this
            ->menuObjectManager
            ->detach($menu);

        return $menu;
    }
363251
public static function loadRepository(CacheRepositoryInterface $repository)
  {
    return self::getOrInit(get_class($repository), function () use ($repository) {
      return $repository->getSingleton();
    });
  }
983759
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->setIo($input, $output);

        $repo = $this->prepareRepository();

        $this->rebuild();

        $this->deployWithGit($repo);
    }
1341261
protected function runCommand(InputInterface $input, OutputInterface $output)
    {
        $this->getRepositoryAndIndices($input, $output);

        $this
            ->repositoryBucket->findRepository($input->getArgument('app-name'))
            ->deleteToken(
                TokenUUID::createById($input->getArgument('uuid'))
            );
    }
473522
public function addRepository(RepositoryInterface $repository)
    {
        if ($repository instanceof IssueRepository) {
            $type = 'issue';
        } else {
            throw new \Exception('Unknown repository type.');
        }

        $this->repositories[$type] = $repository;
    }
417019
public function fire()
    {
        $entityName      = $this->parseName($this->argument('name'));
        $pieces          = explode('\\', $entityName);
        $entityShortName = array_pop($pieces);

        $this->appNamespace        = $this->laravel->getNamespace();
        $this->entityNamespace     = implode('\\', $pieces);
        $this->contractNamespace   = $this->appNamespace . 'Contracts\Repository';
        $this->repositoryNamespace = $this->appNamespace . 'Repositories';

        $repoName         = $entityShortName . 'Repository';
        $repoAppEntity    = $this->appNamespace . 'Support\AppEntityRepository';
        $repoContractName = sprintf('%s\%s', $this->contractNamespace, $repoName);
        $repoConcreteName = sprintf('%s\%s', $this->repositoryNamespace, $repoName);

        $traits     = new Collection();
        $interfaces = new Collection();

        $this->buildBehaviourOptions($traits, $interfaces);

        $this->createFile($entityName, $this->entityClassStub($entityShortName, $interfaces, $traits));

        if ($this->option('repository')) {
            $this->createFile($repoAppEntity,    $this->appRepositoryClassStub());
            $this->createFile($repoConcreteName, $this->repositoryClassStub($repoName));
            $this->createFile($repoContractName, $this->repositoryInterfaceStub($repoName));
        }

        return 0;
    }
1266990
public function handle()
    {
        $git_url = $this->argument('$git_url');
        $warning = 'This will overrite you Auth view files. Do you wish to continue? [y|N]';
        if ($this->confirm($warning)) {
            $this->info('Getting auth theme from github');
            $process = new Process('git clone '. $git_url . ' tmp_auth && rm -rf tmp_auth/.git && rm -f tmp_auth/readme.md && cp -rf tmp_auth/* resources/views/ && rm -rf tmp_auth');
            $process->run();

            // executes after the command finishes
            if (!$process->isSuccessful()) {
                throw new ProcessFailedException($process);
            }

            echo $process->getOutput();
            $this->info('Successfully added auth theme');
        } else {
            $this->info('Alright, we wount touch anything!');
        }
    }
1241074
public function execute(InputInterface $input, OutputInterface $output)
    {
        try {
            $output->writeln(
                '<comment>Generating new Embeddable  '
                . $input->getOption(static::OPT_NEW_EMBEDDABLE_CATEGORY_NAME) . '\\' .
                $input->getOption(static::OPT_NEW_EMBEDDABLE_NAME)
                . '</comment>'
            );
            $this->checkOptions($input);
            $this->action
                ->setProjectRootDirectory($input->getOption(AbstractCommand::OPT_PROJECT_ROOT_PATH))
                ->setProjectRootNamespace($input->getOption(AbstractCommand::OPT_PROJECT_ROOT_NAMESPACE))
                ->setCatName($input->getOption(static::OPT_NEW_EMBEDDABLE_CATEGORY_NAME))
                ->setName($input->getOption(static::OPT_NEW_EMBEDDABLE_NAME))
                ->run();
            $output->writeln('<info>completed</info>');
        } catch (\Exception $e) {
            throw new DoctrineStaticMetaException(
                'Exception in ' . __METHOD__ . ': ' . $e->getMessage(),
                $e->getCode(),
                $e
            );
        }
    }
448242
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->setIo($input, $output);

        /** @var Repository $config */
        $config = $this->container['config'];

        $sourceRepoPath = $config['source.directory'];
        $sourceRepoUrl = $config['source.git.url'];
        $sourceRepoBranch = $config['source.git.branch'];

        $this->checkSourceRepoSettings($sourceRepoPath, $sourceRepoUrl);

        $output->writeln([
            "<b>steak pull configuration:</b>",
            " Source repository remote is <path>{$sourceRepoUrl}</path>",
            " Source repository branch is <path>{$sourceRepoBranch}</path>",
            " Path to local repository is <path>{$sourceRepoPath}</path>",
        ], OutputInterface::VERBOSITY_VERBOSE);

        if ($this->files->exists($sourceRepoPath)) {

            $workingCopy = $this->git->workingCopy($sourceRepoPath);

            if ( ! $workingCopy->isCloned()) {
                throw new RuntimeException("<path>{$sourceRepoPath}</path> exists but is not a git repository.");
            }

            if ($workingCopy->getBranches()->head() != $sourceRepoBranch) {
                throw new RuntimeException("<path>{$sourceRepoPath}</path> exists but isn't on the <path>{$sourceRepoBranch}</path> branch.");
            }

            $this->git->streamOutput();
            $workingCopy->pull();

        } else {
            $output->writeln([
                "The source directory <path>$sourceRepoPath</path> does not exist.",
                "  Attempting clone from {$sourceRepoUrl}",
            ]);

            $this->git->streamOutput();
            $this->git->cloneRepository($sourceRepoUrl, $sourceRepoPath, [
                'single-branch' => true,
                'branch' => $sourceRepoBranch
            ]);

            $output->writeln("<info>Clone complete! Edit your sources in <path>{$sourceRepoPath}</path></info>");
        }

        $output->writeln("Try <comment>steak serve</comment> to fire up the local development server...");
    }
961328
public function handle()
    {
        $this->repository->setSource($this->determineConnection());

        $this->repository->createRepository();

        $this->info('CMS migration table created successfully.');
    }
487289
public function handle()
    {
        $this->repository->setSource($this->input->getOption('database'));

        $this->repository->createRepository();

        $this->info('Migration table created successfully.');
    }
362248
public function setCustomRepositoryClass(?string $repositoryClassName) : void
    {
        if ($this->isEmbeddedDocument || $this->isQueryResultDocument) {
            return;
        }

        $this->customRepositoryClassName = $repositoryClassName;
    }