class UserRepository

Methods

User>
query()

<p>Get a new query builder for the users table.</p>

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

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

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

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

User|null
findByIdentification(string $identification)

<p>Find a user by an identification (username or email).</p>

User|null
findByEmail(string $email)

<p>Find a user by email.</p>

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

<p>Get the ID of a user with the given username.</p>

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

No description

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

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

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

<p>Scope a query to only include records that are visible to a user.</p>

Details

User> query()

<p>Get a new query builder for the users table.</p>

Return Value

User>

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

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

Parameters

int|string $id
User $actor

Return Value

User

Exceptions

ModelNotFoundException

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

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

Parameters

string $username
User $actor

Return Value

User

Exceptions

ModelNotFoundException

User|null findByIdentification(string $identification)

<p>Find a user by an identification (username or email).</p>

Parameters

string $identification

Return Value

User|null

User|null findByEmail(string $email)

<p>Find a user by email.</p>

Parameters

string $email

Return Value

User|null

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

<p>Get the ID of a user with the given username.</p>

Parameters

string $username
User $actor

Return Value

int|null

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

Parameters

array $usernames
User $actor

Return Value

array

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

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

Parameters

string $string
User $actor

Return Value

array

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

<p>Scope a query to only include records that are visible to a user.</p>

Parameters

Builder $query
User $actor

Return Value

User>