Laratrust\MigrationCommand::fire PHP Method

fire() public method

Execute the console command.
public fire ( ) : void
return void
    public function fire()
    {
        $this->laravel->view->addNamespace('laratrust', substr(__DIR__, 0, -8) . 'views');
        $rolesTable = Config::get('laratrust.roles_table');
        $roleUserTable = Config::get('laratrust.role_user_table');
        $permissionsTable = Config::get('laratrust.permissions_table');
        $permissionRoleTable = Config::get('laratrust.permission_role_table');
        $permissionUserTable = Config::get('laratrust.permission_user_table');
        $this->line('');
        $this->info("Tables: {$rolesTable}, {$roleUserTable}, {$permissionsTable}, {$permissionRoleTable}, {$permissionUserTable}");
        $message = $this->generateMigrationMessage($rolesTable, $roleUserTable, $permissionsTable, $permissionRoleTable, $permissionUserTable);
        $this->comment($message);
        $existingMigrations = $this->alreadyExistingMigrations();
        if ($existingMigrations) {
            $this->line('');
            $this->warn($this->getExistingMigrationsWarning($existingMigrations));
        }
        $this->line('');
        if (!$this->confirm("Proceed with the migration creation?", "yes")) {
            return;
        }
        $this->line('');
        $this->info("Creating migration...");
        if ($this->createMigration()) {
            $this->info("Migration successfully created!");
        } else {
            $this->error("Couldn't create migration.\n" . "Check the write permissions within the database/migrations directory.");
        }
        $this->line('');
    }