Heratio Framework API Reference

UserService
in package

User Service - Replaces QubitUser.

Provides user management using Laravel Query Builder.

Tags
author

Johan Pieterse johan@theahg.co.za

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|null

getAll()

Get all users.

public static getAll() : Collection
Return values
Collection

getByEmail()

Get user by email.

public static getByEmail(string $email) : object|null
Parameters
$email : string
Return values
object|null

getById()

Get user by ID.

public static getById(int $id) : object|null

Replaces: QubitUser::getById($id)

Parameters
$id : int
Return values
object|null

getBySlug()

Get user by slug.

public static getBySlug(string $slug) : object|null

Replaces: QubitUser::getBySlug($slug)

Parameters
$slug : string
Return values
object|null

getByUsername()

Get user by username.

public static getByUsername(string $username) : object|null
Parameters
$username : string
Return values
object|null

getGroups()

Get user's groups.

public static getGroups(int $userId) : Collection
Parameters
$userId : int
Return values
Collection

isActive()

Check if user is active.

public static isActive(int $userId) : bool
Parameters
$userId : int
Return values
bool

updatePassword()

Update password.

public static updatePassword(int $userId, string $newPassword) : bool
Parameters
$userId : int
$newPassword : string
Return values
bool

        
On this page

Search results