Execute the console command.

@throws \Doctrine\DBAL\DBALException

@return bool|null
6839
public function handle()
    {
        $this->tables = $this->getTablesFromMWBFile();
        if ($this->tables === false) {
            return false;
        }
        $this->getAppJson();

        $this->databaseService = new DatabaseService($this->config, $this->files);
        $this->databaseService->resetDatabase();

        $this->generateMigration();

        $this->databaseService->dropDatabase();

        return true;
    }
167289
public function handle()
    {
        $content = $this->dbTransaction(function () {
            $content = new Content();
            $content->fill([
                'type'               => $this->attributes['type'],
                'theme'              => $this->attributes['theme'],
                'weight'             => $this->attributes['weight'],
                'rating'             => $this->attributes['rating'],
                'is_on_home'         => $this->attributes['is_on_home'],
                'is_promoted'        => $this->attributes['is_promoted'],
                'is_sticky'          => $this->attributes['is_sticky'],
                'is_comment_allowed' => $this->attributes['is_comment_allowed'],
                'published_at'       => $this->attributes['published_at']
            ]);
            $content->author()->associate($this->author);

            if ($this->attributes['parent_id']) {
                $parent = Content::find($this->attributes['parent_id']);
                if (!$parent) {
                    throw new InvalidArgumentException('Parent not found');
                }

                $content->setChildOf($parent);
            } else {
                $content->setAsRoot();
            }

            $translation = new ContentTranslation();
            $translation->fill([
                'title'           => $this->title,
                'language_code'   => $this->language->code,
                'teaser'          => $this->attributes['teaser'],
                'body'            => $this->attributes['body'],
                'seo_title'       => $this->attributes['seo_title'],
                'seo_description' => $this->attributes['seo_description'],
                'is_active'       => true,
            ]);
            $translation->author()->associate($this->author);

            $content->translations()->save($translation);
            $content->createRoute($translation, $this->attributes['is_active']);

            event('content.created', [$content]);
            return $content;
        });
        return $content;
    }
808956
public function handle()
    {
        $seed = new DatabaseSeeder();
        $seed->run();

        $this->line("Seeding: RoleTableSeeder");
        //$this->line("Seeding: UserTableSeeder");
        $this->line("Seeding: BannerTableSeeder");
        $this->line("Seeding: PageTableSeeder");
        $this->line("Seeding: NavigationAdminTableSeeder");
        $this->info("Database seeding completed successfully.");

        //$this->line("User Credentials");
        //$this->info("Email: admin@laravel.local");
        //$this->info("Password: admin");
    }
297577
public function handle()
    {
        /** @var \Illuminate\Database\Connection|CouchbaseConnection $connection */
        $connection = $this->databaseManager->connection($this->option('database'));
        if ($connection instanceof CouchbaseConnection) {
            $bucket = $connection->openBucket($this->argument('bucket'));
            $name = $this->argument('name');
            $bucket->manager()->dropN1qlIndex(
                $name,
                $this->option('ignore')
            );
            $this->info("dropped SECONDARY INDEX [{$name}] for [{$this->argument('bucket')}] bucket.");
        }

        return;
    }
198790
public function handle()
    {
        return $this->dbTransaction(function () {
            $lastAction = $this->block->restore();

            event('block.restored', [$this->block]);

            return $lastAction;
        });
    }
226339
public function handle()
    {
        if (! $this->confirmToProceed()) {
            return;
        }

        $parameters = [
            'driver' => $this->getDriver(),
            '--database' => $this->option('database'),
            '--force' => true,
            '--id' => $this->option('id'),
        ];

        $this->call('tenanti:reset', $parameters);

        // The refresh command is essentially just a brief aggregate of a few other of
        // the migration commands and just provides a convenient wrapper to execute
        // them in succession. We'll also see if we need to re-seed the database.
        $this->call('tenanti:migrate', $parameters);
    }
781304
public function handle()
    {
        $this->migrator->setConnection($this->option('database'));

        if (!$this->migrator->repositoryExists()) {
            return $this->error('No migrations found.');
        }

        $ran = $this->migrator->getRepository()->getRan();

        if (count($migrations = $this->getStatusFor($ran)) > 0) {
            $this->table(['Ran?', 'Migration'], $migrations);
        } else {
            $this->error('No migrations found');
        }
    }
157183
public function handle()
    {
        $self = $this;
        $self->info("Patching database... \n");
        $unOption = $this->option('uninstall');
        $inOption = $this->option('install');

        $sqlPath = app('config')->get('phpgit.path');
        $branch = $self->getBranch($self);

        $uninstallSqlFile = strtolower(dirname(app_path()).$sqlPath.$branch."-uninstall.sql");
        $installSqlFile = strtolower(dirname(app_path()).$sqlPath.$branch."-install.sql");
        $productionUninstallSqlFile = strtolower(dirname(app_path()).$sqlPath."production-uninstall.sql");
        $productionInstallSqlFile = strtolower(dirname(app_path()).$sqlPath."production-install.sql");

        $production =(env('APP_ENV') === 'production');
        if($production){
            $self->executeSql($unOption,$inOption,$productionUninstallSqlFile,$productionInstallSqlFile);
        }else{
            $self->executeSql($unOption,$inOption,$uninstallSqlFile,$installSqlFile);
        }

        return $self->info("Patching Database Success\n");
    }
987183
public function handle()
    {
        $connection = $this->getConnection();
        $schema = $this->getSchema($connection);
        $table = $this->getTable();

        // Check whether we just need to generate one table
        if ($table) {
            $this->models->on($connection)->create($schema, $table);
            $this->info("Check out your models for $table");
        }

        // Otherwise map the whole database
        else {
            $this->models->on($connection)->map($schema);
            $this->info("Check out your models for $schema");
        }
    }
1154966
public function handle()
    {
        $this->addon = $this->getAddon();

        if (parent::handle() !== false) {
            if ($this->option('migration')) {
                $table = $this->toTable($this->argument('name'));

                $this->call('make:migration', [
                    'name' => $this->option('migration'),
                    '--addon' => $this->option('addon'),
                    '--create' => $table,
                ]);
            }
        }
    }
195660
public function fire()
	{
		$table = $this->laravel['config']['queue.connections.database.table'];

		$tableClassName = Str::studly($table);

		$fullPath = $this->createBaseMigration($table);

		$stub = str_replace(
			['{{table}}', '{{tableClassName}}'], [$table, $tableClassName], $this->files->get(__DIR__.'/stubs/jobs.stub')
		);

		$this->files->put($fullPath, $stub);

		$this->info('Migration created successfully!');

		$this->composer->dumpAutoloads();
	}
438450
public function fire()
	{
		if (! $this->migrator->repositoryExists()) {
			return $this->error('No migrations found.');
		}

		$this->migrator->setConnection($this->input->getOption('database'));

		if (! is_null($path = $this->input->getOption('path'))) {
			$path = $this->laravel->basePath().'/'.$path;
		} else {
			$path = $this->getMigrationPath();
		}

		$ran = $this->migrator->getRepository()->getRan();

		$migrations = [];

		foreach ($this->getAllMigrationFiles($path) as $migration) {
			$migrations[] = in_array($migration, $ran) ? ['<info>Y</info>', $migration] : ['<fg=red>N</fg=red>', $migration];
		}

		if (count($migrations) > 0) {
			$this->table(['Ran?', 'Migration'], $migrations);
		} else {
			$this->error('No migrations found');
		}
	}
413986
public function fire()
    {
        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->container['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->container['migrator']->getNotes() 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]);
        }
    }
700726
public function handle()
    {
        if (! $this->confirmToProceed()) {
            return;
        }

        $this->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 (! $this->migrator->repositoryExists()) {
            return $this->comment('Migration table not found.');
        }

        $this->migrator->setOutput($this->output)->reset(
            $this->getMigrationPaths(), $this->option('pretend')
        );
    }
939369
public function fire()
	{
		$this->repository->setSource($this->input->getOption('database'));

		$this->repository->createRepository();

		$this->info('Migration table created successfully.');
	}
1024262
public function fire()
    {
        // if clean option is checked empty iSeed template in DatabaseSeeder.php
        if ($this->option('clean')) {
            app('iseed')->cleanSection();
        }

        $tables = explode(",", $this->argument('tables'));
        $max = intval($this->option('max'));
        $chunkSize = intval($this->option('chunksize'));
        $exclude = explode(",", $this->option('exclude'));
        $prerunEvents = explode(",", $this->option('prerun'));
        $postrunEvents = explode(",", $this->option('postrun'));
        $dumpAuto = intval($this->option('dumpauto'));
        $indexed = !$this->option('noindex');
        $orderBy = $this->option('orderby');
        $direction = $this->option('direction');
        $prefix = $this->option('classnameprefix');
        $suffix = $this->option('classnamesuffix');

        if ($max < 1) {
            $max = null;
        }

        if ($chunkSize < 1) {
            $chunkSize = null;
        }

        $tableIncrement = 0;
        foreach ($tables as $table) {
            $table = trim($table);
            $prerunEvent = null;
            if (isset($prerunEvents[$tableIncrement])) {
                $prerunEvent = trim($prerunEvents[$tableIncrement]);
            }
            $postrunEvent = null;
            if (isset($postrunEvents[$tableIncrement])) {
                $postrunEvent = trim($postrunEvents[$tableIncrement]);
            }
            $tableIncrement++;

            // generate file and class name based on name of the table
            list($fileName, $className) = $this->generateFileName($table, $prefix, $suffix);

            // if file does not exist or force option is turned on generate seeder
            if (!\File::exists($fileName) || $this->option('force')) {
                $this->printResult(
                    app('iseed')->generateSeed(
                        $table,
                        $prefix,
                        $suffix,
                        $this->option('database'),
                        $max,
                        $chunkSize,
                        $exclude,
                        $prerunEvent,
                        $postrunEvent,
                        $dumpAuto,
                        $indexed,
                        $orderBy,
                        $direction
                    ),
                    $table
                );
                continue;
            }

            if ($this->confirm('File ' . $className . ' already exist. Do you wish to override it? [yes|no]')) {
                // if user said yes overwrite old seeder
                $this->printResult(
                    app('iseed')->generateSeed(
                        $table,
                        $prefix,
                        $suffix,
                        $this->option('database'),
                        $max,
                        $chunkSize,
                        $exclude,
                        $prerunEvent,
                        $postrunEvent,
                        $dumpAuto,
                        $indexed
                    ),
                    $table
                );
            }
        }

        return;
    }
985480
public function fire()
    {
        if (!$this->confirmToProceed()) {
            return;
        }
        $this->prepareDatabase();
        $pluggable = $this->pluggable->getProperties($this->argument('pluggable'));

        if (!empty($pluggable)) {
            if ($this->pluggable->isEnabled($pluggable['slug'])) {
                return $this->migrate($pluggable['slug']);
            } elseif ($this->option('force')) {
                return $this->migrate($pluggable['slug']);
            }
        } else {
            if ($this->option('force')) {
                $pluggables = $this->pluggable->all();
            } else {
                $pluggables = $this->pluggable->getByEnabled();
            }
            foreach ($pluggables as $pluggable) {
                $this->migrate($pluggable['slug']);
            }
        }
    }