Ejemplo n.º 1
0
 public function getToken()
 {
     $user = $this->user;
     $token = UserPasswordResetToken::findOne(['user_id' => $user->id]);
     if ($token == null) {
         $token = new UserPasswordResetToken();
         $token->user_id = $user->id;
         $token->token = $user->generatePasswordResetToken();
         $token->save();
     }
     return $token;
 }