HasUserState
trait HasUserState (View source)
Methods to give a model per-user state.
Methods
Details
HasOne
userState(User $user = null)
Relationship with the state record for a user.
Defaults to the current user when no user is specified, as is the case when eager-loading the relationship.
The model representing the user state table is derived by appending
User
to the parent model name (eg. PostUser
). Alternatively, it can
be specified by setting the userStateModel
property.
HasUserState
loadUserState(User $user)
Load the userState relationship for the given user.