api auth email
This commit is contained in:
@ -41,7 +41,7 @@ class UserService
|
||||
* @param string $value
|
||||
* @return mixed
|
||||
*/
|
||||
public function getByField(string $field, string $value)
|
||||
public static function getByField(string $field, string $value): mixed
|
||||
{
|
||||
return User::where($field, $value)->first();
|
||||
}
|
||||
@ -91,8 +91,6 @@ class UserService
|
||||
$user->email = $email;
|
||||
$user->username = $email;
|
||||
$user->password_hash = password_hash($password, PASSWORD_DEFAULT);
|
||||
$user->auth_code = mt_rand(100000, 999999);
|
||||
$user->auth_code_expires_at = date("Y-m-d H:i:s", strtotime("+5 minutes"));
|
||||
$user->save();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user