REBELinBLUE\Deployer\Contracts\Repositories\UserRepositoryInterface::updateById PHP Method

updateById() public method

public updateById ( array $fields, integer $model_id ) : Model
$fields array
$model_id integer
return Illuminate\Database\Eloquent\Model
    public function updateById(array $fields, $model_id);

Usage Example

Example #1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     if (!$this->verifyNotInstalled()) {
         return -1;
     }
     $this->clearCaches();
     $config = base_path('.env');
     if (!file_exists($config)) {
         copy(base_path('.env.example'), $config);
         Config::set('app.key', 'SomeRandomString');
     }
     $this->line('');
     $this->info('***********************');
     $this->info('  Welcome to Deployer  ');
     $this->info('***********************');
     $this->line('');
     if (!$this->checkRequirements()) {
         return -1;
     }
     $this->line('Please answer the following questions:');
     $this->line('');
     $config = ['db' => $this->getDatabaseInformation(), 'app' => $this->getInstallInformation(), 'mail' => $this->getEmailInformation()];
     $admin = $this->getAdminInformation();
     $config['jwt']['secret'] = $this->generateJWTKey();
     $this->writeEnvFile($config);
     $this->generateKey();
     $this->migrate($this->getLaravel()->environment() === 'local');
     $this->repository->updateById($admin, 1);
     $this->clearCaches();
     $this->optimize();
     $this->line('');
     $this->info('Success! Deployer is now installed');
     $this->line('');
     $this->header('Next steps');
     $this->line('');
     $this->line('Example configuration files can be found in the "examples" directory');
     $this->line('');
     $this->comment('1. Set up your web server, see either "nginx.conf" or "apache.conf"');
     $this->line('');
     $this->comment('2. Setup the cronjobs, see "crontab"');
     $this->line('');
     $this->comment('3. Setup the socket server & queue runner, see "supervisor.conf" for an example commands');
     $this->line('');
     $this->comment('4. Ensure that "storage" and "public/upload" are writable by the webserver');
     $this->line('');
     $this->comment('5. Visit ' . $config['app']['url'] . ' and login with the details you provided to get started');
     $this->line('');
 }
All Usage Examples Of REBELinBLUE\Deployer\Contracts\Repositories\UserRepositoryInterface::updateById