/** * Handle the command. * * @param $command */ public function handle($command) { $user = $this->userRepository->requireBySlug($command->slug); $user->edit($command->firstName, $command->lastName, $command->email, $command->password); $this->userRepository->save($user); $this->dispatcher->dispatch($user->releaseEvents()); }
/** * Handle the command. * * @param $command * * @return \Tectonic\Shift\Modules\Identity\Users\Models\User */ public function handle($command) { $user = User::register($command->firstName, $command->lastName, $command->email, $command->password); $this->userRepository->save($user); $account = CurrentAccount::get(); $account->addUser($user); $this->eventDispatcher->dispatch($user->releaseEvents()); return $user; }
/** * Handle the command. * * @param SendRegistrationEmailCommand $command */ public function handle($command) { $user = $command->user; $user->generateConfirmationToken(); $this->userRepository->save($user); // TODO: Implement based on notifications module // Notifier::make($user->email, 'users.register', [ // 'name' => $user->getName(), // 'confirmation_url' => URL::base() . '/users/confirm/' . $user->confirmation_token // ]); }
/** * Handle the command. * * @param $command */ public function handle($command) { // Create account $account = Account::install(); // Add new user record and assign to account $user = User::install($command->email, $command->password); $this->users->save($user); $account->setOwner($user); $this->accountRepository->save($account); // Set the current account for the request. This is necessary for some other tasks CurrentAccount::set($account); $language = $this->addLanguage($account, $command->language); $account->addUser($user); $account->addTranslation($language->code, 'name', $command->name); $account->addDomain($command->host); // Dispatch all events associated with various objects $this->dispatcher->dispatch($account->releaseEvents()); $this->dispatcher->dispatch($user->releaseEvents()); }
/** * Handle the command. * * @param $command */ public function handle($command) { $user = User::add($command->firstName, $command->lastName, $command->email, $command->password); $this->userRepository->save($user); $this->dispatcher->dispatch($user->releaseEvents()); }