UserService
in package
User Service - Replaces QubitUser.
Provides user management using Laravel Query Builder.
Tags
Table of Contents
Methods
- authenticate() : object|null
- Authenticate user.
- getAll() : Collection
- Get all users.
- getByEmail() : object|null
- Get user by email.
- getById() : object|null
- Get user by ID.
- getBySlug() : object|null
- Get user by slug.
- getByUsername() : object|null
- Get user by username.
- getGroups() : Collection
- Get user's groups.
- isActive() : bool
- Check if user is active.
- updatePassword() : bool
- Update password.
Methods
authenticate()
Authenticate user.
public
static authenticate(string $emailOrUsername, string $password) : object|null
Parameters
- $emailOrUsername : string
- $password : string
Return values
object|nullgetAll()
Get all users.
public
static getAll() : Collection
Return values
CollectiongetByEmail()
Get user by email.
public
static getByEmail(string $email) : object|null
Parameters
- $email : string
Return values
object|nullgetById()
Get user by ID.
public
static getById(int $id) : object|null
Replaces: QubitUser::getById($id)
Parameters
- $id : int
Return values
object|nullgetBySlug()
Get user by slug.
public
static getBySlug(string $slug) : object|null
Replaces: QubitUser::getBySlug($slug)
Parameters
- $slug : string
Return values
object|nullgetByUsername()
Get user by username.
public
static getByUsername(string $username) : object|null
Parameters
- $username : string
Return values
object|nullgetGroups()
Get user's groups.
public
static getGroups(int $userId) : Collection
Parameters
- $userId : int
Return values
CollectionisActive()
Check if user is active.
public
static isActive(int $userId) : bool
Parameters
- $userId : int
Return values
boolupdatePassword()
Update password.
public
static updatePassword(int $userId, string $newPassword) : bool
Parameters
- $userId : int
- $newPassword : string