class UserRepository

Methods

Builder
query()

No description

Model
findOrFail(int|string $id, User|null $actor = null)

Find a user by ID, optionally making sure it is visible to a certain user, or throw an exception.

Model
findOrFailByUsername(string $username, User|null $actor = null)

Find a user by username, optionally making sure it is visible to a certain user, or throw an exception.

Model|null
findByIdentification(string $identification)

Find a user by an identification (username or email).

Model|null
findByEmail(string $email)

No description

int|null
getIdForUsername(string $username, User|null $actor = null)

No description

array
getIdsForUsernames(array $usernames, User|null $actor = null)

No description

array
getIdsForUsername(string $string, User|null $actor = null)

Find users by matching a string of words against their username, optionally making sure they are visible to a certain user.

Builder
scopeVisibleTo(Builder $query, User|null $actor = null)

No description

Details

Builder query()

Return Value

Builder

Model findOrFail(int|string $id, User|null $actor = null)

Find a user by ID, optionally making sure it is visible to a certain user, or throw an exception.

Parameters

int|string $id
User|null $actor

Return Value

Model

Exceptions

ModelNotFoundException

Model findOrFailByUsername(string $username, User|null $actor = null)

Find a user by username, optionally making sure it is visible to a certain user, or throw an exception.

Parameters

string $username
User|null $actor

Return Value

Model

Exceptions

ModelNotFoundException

Model|null findByIdentification(string $identification)

Find a user by an identification (username or email).

Parameters

string $identification

Return Value

Model|null

Model|null findByEmail(string $email)

Parameters

string $email

Return Value

Model|null

int|null getIdForUsername(string $username, User|null $actor = null)

Parameters

string $username
User|null $actor

Return Value

int|null

array getIdsForUsernames(array $usernames, User|null $actor = null)

Parameters

array $usernames
User|null $actor

Return Value

array

array getIdsForUsername(string $string, User|null $actor = null)

Find users by matching a string of words against their username, optionally making sure they are visible to a certain user.

Parameters

string $string
User|null $actor

Return Value

array

protected Builder scopeVisibleTo(Builder $query, User|null $actor = null)

Parameters

Builder $query
User|null $actor

Return Value

Builder