Exemplo n.º 1
0
 public function verify($verificationCode)
 {
     $user = User::where('verification_code', '=', $verificationCode)->where('verified', '=', false)->firstOrFail();
     $user->verified = true;
     $user->save();
     $this->userMailer->sendWelcomeMessageTo($user);
     return $user;
 }
 public function store(RegistrationRequest $request)
 {
     $user = User::register($request->get('name'), $request->get('email'), $request->get('password'), $request->has('verified'));
     $this->userRepository->register($user);
     $this->userRepository->login($user);
     flash()->message('Thank you for registering');
     return $user->verified ? redirect()->route('droplets_path') : redirect()->route('unverified_path');
 }
Exemplo n.º 3
0
 public function getPaginatedForUser($userId)
 {
     return User::findOrFail($userId)->droplets()->latest()->paginate();
 }
Exemplo n.º 4
0
 public function saveCredentials($userId, $credentials)
 {
     $credentials = new Storage(compact('credentials'));
     return User::findOrFail($userId)->storages()->save($credentials);
 }