Method |
Description |
|
accessTokens ( ) : Illuminate\Database\Eloquent\Relations\HasMany |
Define the relationship with the user's access tokens. |
|
activate ( ) |
Activate the user's account. |
|
addPreference ( string $key, callable $transformer = null, mixed $default = null ) |
Register a preference with a transformer and a default value. |
|
boot ( ) : void |
Boot the model. |
|
can ( string $ability, array | mixed $arguments = [] ) : boolean |
|
|
cannot ( string $ability, array | mixed $arguments = [] ) : boolean |
|
|
changeAvatarPath ( string $path ) |
Change the path of the user avatar. |
|
changeBio ( string $bio ) |
Change the user's bio. |
|
changeEmail ( string $email ) |
Change the user's email. |
|
changePassword ( string $password ) |
Change the user's password. |
|
checkPassword ( string $password ) : boolean |
Check if a given password matches the user's password. |
|
getAlertableNotificationTypes ( ) : array |
Get the notification types that should be alerted to this user, according
to their preferences. |
|
getAvatarUrlAttribute ( ) : string |
Get the URL of the user's avatar. |
|
getGate ( ) : Flarum\Core\Access\Gate |
|
|
getLocaleAttribute ( string $value ) : string |
Get the user's locale, falling back to the forum's default if they
haven't set one. |
|
getNewNotificationsCount ( ) : integer |
Get the number of new, unseen notifications for the user. |
|
getNotificationPreferenceKey ( string $type, string $method ) : string |
Get the key for a preference which flags whether or not the user will
receive a notification for $type via $method. |
|
getPermissions ( ) : string[] |
Get a list of permissions that the user has. |
|
getPreference ( string $key, mixed $default = null ) : mixed |
Get the value of a preference for this user. |
|
getPreferencesAttribute ( string $value ) : array |
Get the values of all registered preferences for this user, by
transforming their stored preferences and merging them with the defaults. |
|
getSession ( ) : Symfony\Component\HttpFoundation\Session\SessionInterface |
|
|
getUnreadNotificationsCount ( ) : integer |
Get the number of unread notifications for the user. |
|
groups ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany |
Define the relationship with the user's groups. |
|
hasPermission ( string $permission ) : boolean |
Check whether the user has a certain permission based on their groups. |
|
hasPermissionLike ( string $match ) : boolean |
Check whether the user has a permission that is like the given string,
based on their groups. |
|
isAdmin ( ) : boolean |
Check whether or not the user is an administrator. |
|
isGuest ( ) : boolean |
Check whether or not the user is a guest. |
|
markAllAsRead ( ) |
Mark all discussions as read. |
|
markNotificationsAsRead ( ) |
Mark all notifications as read. |
|
notifications ( ) : Illuminate\Database\Eloquent\Relations\HasMany |
Define the relationship with the user's notifications. |
|
permissions ( ) : Builder |
Define the relationship with the permissions of all of the groups that
the user is in. |
|
posts ( ) : Illuminate\Database\Eloquent\Relations\HasMany |
Define the relationship with the user's posts. |
|
read ( ) : BelongsTo |
Define the relationship with the user's read discussions. |
|
register ( string $username, string $email, string $password ) : static |
Register a new user. |
|
rename ( string $username ) |
Rename the user. |
|
requestEmailChange ( string $email ) |
Request that the user's email be changed. |
|
setGate ( Flarum\Core\Access\Gate $gate ) |
|
|
setHasher ( Illuminate\Contracts\Hashing\Hasher $hasher ) |
Set the hasher with which to hash passwords. |
|
setPasswordAttribute ( string $value ) |
Set the password attribute, storing it as a hash. |
|
setPreference ( string $key, mixed $value ) |
Set the value of a preference for this user. |
|
setPreferencesAttribute ( mixed $value ) |
Encode an array of preferences for storage in the database. |
|
setSession ( Symfony\Component\HttpFoundation\Session\SessionInterface $session ) |
|
|
shouldAlert ( string $type ) : boolean |
Check whether or not the user should receive an alert for a notification
type. |
|
shouldEmail ( string $type ) : boolean |
Check whether or not the user should receive an email for a notification
type. |
|
updateLastSeen ( ) |
Set the user as being last seen just now. |
|