kernel, env, compoder, botstrap update

This commit is contained in:
2024-12-09 16:46:31 +03:00
parent 0e0bc80260
commit bfeb2d3c56
30 changed files with 926 additions and 56 deletions

View File

@ -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();
}
}