public function handle(User $user)
 {
     $user->last_post = Carbon::now();
     $user->num_posts += 1;
     $user->save();
 }
示例#2
0
 /**
  * Run the action and return a response for the user.
  *
  * @return void
  */
 protected function run()
 {
     $user = new User(['username' => $this->get('username'), 'group_id' => $this->config->get('o_default_user_group'), 'password' => $this->get('password'), 'email' => $this->get('email'), 'email_setting' => $this->config->get('o_default_email_setting'), 'timezone' => $this->config->get('o_default_timezone'), 'dst' => $this->config->get('o_default_dst'), 'language' => $this->config->get('o_default_lang'), 'style' => $this->config->get('o_default_style'), 'registration_ip' => $this->get('ip')]);
     $user->save();
     $this->raise(new UserHasRegistered($user));
 }