kernel, env, compoder, botstrap update
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();
|
||||
}
|
||||
@ -85,4 +85,13 @@ class UserService
|
||||
return $this->getByField("access_token", $token);
|
||||
}
|
||||
|
||||
public static function createUserByEmailAndPassword(string $email, string $password): void
|
||||
{
|
||||
$user = new User();
|
||||
$user->email = $email;
|
||||
$user->username = $email;
|
||||
$user->password_hash = password_hash($password, PASSWORD_DEFAULT);
|
||||
$user->save();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user