Inheritance: extends App\Services\Auth\User
 /**
  * Display the password reset view for the given token.
  *
  * If no token is present, display the link request form.
  *
  * @param \Illuminate\Http\Request $request
  * @param string|null              $token
  *
  * @return \Illuminate\Http\Response
  */
 public function showResetForm(Request $request, $token = null)
 {
     if (!($user = User::findByToken($token))) {
         flash()->error(trans('passwordReset.invalidToken'));
         return redirect()->to(login_url());
     }
     return view('back.auth.resetPassword')->with(['token' => $token, 'email' => $request->email, 'user' => $user]);
 }
 public function seedAdmins()
 {
     $users = ['Willem' => 'Van Bockstal', 'Freek' => 'Van der Herten', 'Rogier' => 'De Boevé', 'Sebastian' => 'De Deyne'];
     collect($users)->each(function ($lastName, $firstName) {
         $password = app()->environment('local') ? strtolower($firstName) : string()->random();
         User::create(['email' => strtolower($firstName) . '@spatie.be', 'password' => bcrypt($password), 'first_name' => $firstName, 'last_name' => $lastName, 'role' => UserRole::ADMIN(), 'status' => UserStatus::ACTIVE()]);
     });
 }
 public function destroy($id)
 {
     $user = User::findOrFail($id);
     $eventDescription = $this->getEventDescriptionFor('deleted', $user);
     $user->delete();
     activity($eventDescription);
     flash()->success(strip_tags($eventDescription));
     return redirect()->action('Back\\AdministratorsController@index');
 }
Exemple #4
0
 protected function getUser(string $identifier) : Authenticatable
 {
     if (!str_contains($identifier, '@')) {
         $identifier .= '@spatie.be';
     }
     if (request()->isBack()) {
         return BackUser::where(['email' => $identifier])->first();
     }
     return FrontUser::where(['email' => $identifier])->first();
 }