/** * 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('front.auth.resetPassword')->with(['token' => $token, 'email' => $request->email, 'user' => $user]); }
public function destroy($id) { $user = User::findOrFail($id); $user->delete(); $eventDescription = $this->getEventDescriptionFor('deleted', $user); activity()->log($eventDescription); flash()->success(strip_tags($eventDescription)); return redirect()->action('Back\\MembersController@index'); }
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(); }
/** * Create a new user instance after a valid registration. * * @param array $data * * @return User */ protected function create(array $data) { return User::register($data); }