User
extends User
in package
implements
User, PrivacyList, IsActivitySubscriptionInterface, ActivityFeedSource, IsPrivacyItemInterface, PostBy, LdapAuthenticatable, IsNotifiable, HasUserProfile, UserHasValuePermission, CanResetPassword, HasGlobalSearch, HasTimelineAlbum, HasApprove, HasFeature
Uses
Notifiable, HasApiTokens, HasRoles, HasNestedAttributes, HasFactory, AuthenticatesWithLdap, UserHasValuePermissionTrait, CanResetPasswordTrait, HasUser, MustVerify
Class User.
Tags
Table of Contents
Interfaces
- User
- Interface User.
- PrivacyList
- Interface Entity.
- IsActivitySubscriptionInterface
- ActivityFeedSource
- Interface ActivityFeedSource.
- IsPrivacyItemInterface
- PostBy
- LdapAuthenticatable
- IsNotifiable
- Interface IsNotifiable.
- HasUserProfile
- Interface HasUserProfile.
- UserHasValuePermission
- CanResetPassword
- HasGlobalSearch
- Interface HasGlobalSearch.
- HasTimelineAlbum
- Interface HasTimelineAlbum
- HasApprove
- Interface HasApprove
- HasFeature
- Interface HasFeature.
Constants
- ENTITY_TYPE = 'user'
- USER_AVATAR_SIGN_UP = 'user_signup_avatar'
- USER_UPDATE_AVATAR_ENTITY_TYPE = 'user_update_avatar'
- USER_UPDATE_COVER_ENTITY_TYPE = 'user_update_cover'
- USER_UPDATE_INFORMATION_ENTITY_TYPE = 'user_update_information'
- USER_UPDATE_RELATIONSHIP_ENTITY_TYPE = 'user_update_relationship'
- DEFAULT_TAB_ABOUT = 'about'
- DEFAULT_TAB_HOME = 'home'
Properties
- $approve_status : string
- $created_at : string
- $email : string
- $email_verified_at : mixed|null
- $first_name : string|null
- $full_name : string
- $full_name_raw : string
- $id : int
- $incrementing : mixed
- $is_approved : int
- $is_featured : bool
- $is_invisible : bool
- $last_name : string|null
- $nestedAttributes : array<string|int, mixed>
- $password : string
- $phone_number : string
- $phone_number_verified_at : mixed|null
- $profile : UserProfile
- $total_friend : int
- $updated_at : string
- $user_name : string
- $userActivity : UserActivity
- $verified_at : mixed|null
- $casts : array<string, string>
- The attributes that should be cast to native types.
- $fillable : array<string|int, string>
- The attributes that are mass assignable.
- $guard_name : string
- This is use for roles, permissions. Please do not remove this.
- $hidden : array<string|int, string>
- The attributes that should be hidden for arrays.
- $nestedAttributesFor : array<string|int, mixed>
- Defined nested attributes.
Methods
- canBeBlocked() : bool
- Determine if resource can be blocked.
- checkContentShareable() : bool
- checkPostBy() : bool
- customProfile() : array<string|int, mixed>
- entityId() : int
- entityType() : string
- factory() : UserFactory
- fill() : static
- Fill the model with an array of attributes.
- findForPassport() : User|null
- Find the user instance for the given username.
- getApprovedMessage() : string|null
- getDeclinedMessage() : string|null
- getDefaultTabMenu() : string
- getDescriptionAttribute() : mixed
- getEmailOptionForPasswordReset() : array<string|int, mixed>|null
- getFullNameAttribute() : string
- getFullNameRawAttribute() : string
- getItemPrivacy() : int|null
- getNestedAttributesFor() : array<string|int, mixed>
- Get accept nested attributes.
- getOwnerAttribute() : mixed
- getOwnerEntityAttribute() : mixed
- getPendingMessage() : string|null
- getPhoneNumberOptionForPasswordReset() : array<string|int, mixed>|null
- getPrivacyPostBy() : int
- Get privacy base on owner's requirement Page => 0 (public) Group => privacy_item User => 1 (friend).
- getProfileAttribute() : mixed
- getRepresentativePrivacy() : int|null
- getRepresentativePrivacyDetail() : array<string|int, mixed>|null
- getResetMethods() : array<string|int, mixed>
- getRole() : Role|null
- getSharedFeedAvatarTypeIdAttribute() : string
- getSharedFeedCoverTypeIdAttribute() : string
- getSmallestRoleId() : int
- getTotalCommentAttribute() : int
- getTotalReplyAttribute() : int
- getUserAttribute() : mixed
- getUserDescription() : string
- getUserEntityAttribute() : mixed
- hasAdminRole() : bool
- hasContentPrivacy() : bool
- hasEmailAddress() : bool
- Check if the user has an associated email address.
- hasFeedDetailPage() : bool
- hasNamedNotification() : null|string
- hasPendingMode() : bool
- hasPermissionValue() : bool
- hasPhoneNumber() : bool
- Check if the user has an associated phone number.
- hasRemoveFeed() : bool
- hasRole() : bool
- hasStaffRole() : bool
- hasSuperAdminRole() : bool
- hasValuePermissionViaRole() : bool
- hasVerified() : bool
- Determine if the user has verified their account.
- isApproved() : bool
- isDeleted() : bool
- isGuest() : bool
- isNotApproved() : bool
- isPendingMode() : bool|null
- isTaggingAllowed() : bool
- markAsVerified() : void
- Mark the user as verified.
- mustVerify() : bool
- Check whether the user needs to verify their registered email / phone number.
- mustVerifyEmailAddress() : bool
- Check whether the user needs to verify their email address.
- mustVerifyPhoneNumber() : bool
- Check whether the user needs to verify their phone number.
- notificationEmail() : string
- notificationFullName() : string
- notificationPhoneNumber() : string
- notificationUserName() : string
- notify() : void
- Send the given notification.
- notifyNow() : void
- Send the given notification immediately.
- owner() : mixed
- ownerEntity() : mixed
- ownerId() : int
- ownerType() : string
- preferredLocale() : string|null
- profile() : HasOne
- resetTokens() : HasMany
- revokeAllTokens() : void
- routeNotificationFor() : mixed
- Get the notification routing information for the given driver.
- save() : bool
- Save the model to the database.
- sendPasswordResetNotification() : void
- Send the password reset notification.
- sendPasswordResetToken() : void
- shouldVerifyEmailAddress() : bool
- Check whether the user should to verify their email address.
- shouldVerifyPhoneNumber() : bool
- Check whether the user should to verify their phone number.
- syncHasManyRelationAttribute() : bool
- Save the hasMany nested relation attributes to the database.
- syncHasOneRelationAttribute() : bool
- toActivityFeed() : FeedAction|null
- toActivitySubscription() : array<string|int, int>
- This method must return [$userId, $ownerId] $userId: who subscribe $ownerId: whom subscribe from When $owner post content on profile, $userId can see $owner feed.
- toApprovedNotification() : array<string|int, mixed>
- toDeclinedContentLink() : string|null
- toDeclinedContentUrl() : string|null
- toLink() : string|null
- toOGDescription() : string|null
- toPaymentSettingUrl() : string
- toPrivacyItem() : array<string|int, mixed>
- Result [ [$userId, $itemId, $itemType, $privacyType] ] $userId: to Insert into privacy_data $itemId: $itemType, $privacyType: to find privacy_id.
- toPrivacyLists() : array<string|int, mixed>
- toRouter() : string|null
- toSearchable() : array<string|int, mixed>|null
- toSitemapUrl() : string|null
- toTitle() : string
- toUrl() : string|null
- toUserResource() : array<string, mixed>
- transformRole() : string
- user() : mixed
- userActivity() : HasOne
- userEntity() : mixed
- userId() : int
- userType() : string
- validateForPassportPasswordGrant() : bool
- validatePassword() : bool
- allowDestroyNestedAttributes() : bool
- Check can we delete nested data.
- newFactory() : UserFactory
- normalizeRoles() : array<string|int, mixed>
Constants
ENTITY_TYPE
public
mixed
ENTITY_TYPE
= 'user'
USER_AVATAR_SIGN_UP
public
mixed
USER_AVATAR_SIGN_UP
= 'user_signup_avatar'
USER_UPDATE_AVATAR_ENTITY_TYPE
public
mixed
USER_UPDATE_AVATAR_ENTITY_TYPE
= 'user_update_avatar'
USER_UPDATE_COVER_ENTITY_TYPE
public
mixed
USER_UPDATE_COVER_ENTITY_TYPE
= 'user_update_cover'
USER_UPDATE_INFORMATION_ENTITY_TYPE
public
mixed
USER_UPDATE_INFORMATION_ENTITY_TYPE
= 'user_update_information'
USER_UPDATE_RELATIONSHIP_ENTITY_TYPE
public
mixed
USER_UPDATE_RELATIONSHIP_ENTITY_TYPE
= 'user_update_relationship'
DEFAULT_TAB_ABOUT
protected
mixed
DEFAULT_TAB_ABOUT
= 'about'
DEFAULT_TAB_HOME
protected
mixed
DEFAULT_TAB_HOME
= 'home'
Properties
$approve_status
public
string
$approve_status
$created_at
public
string
$created_at
public
string
$email
$email_verified_at
public
mixed|null
$email_verified_at
$first_name
public
string|null
$first_name
$full_name
public
string
$full_name
$full_name_raw
public
string
$full_name_raw
$id
public
int
$id
$incrementing
public
mixed
$incrementing
= false
$is_approved
public
int
$is_approved
$is_featured
public
bool
$is_featured
$is_invisible
public
bool
$is_invisible
$last_name
public
string|null
$last_name
$nestedAttributes
public
array<string|int, mixed>
$nestedAttributes
= ['profile']
$password
public
string
$password
$phone_number
public
string
$phone_number
$phone_number_verified_at
public
mixed|null
$phone_number_verified_at
$profile
public
UserProfile
$profile
$total_friend
public
int
$total_friend
$updated_at
public
string
$updated_at
$user_name
public
string
$user_name
$userActivity
public
UserActivity
$userActivity
$verified_at
public
mixed|null
$verified_at
$casts
The attributes that should be cast to native types.
protected
array<string, string>
$casts
= ['email_verified_at' => 'datetime', 'is_featured' => 'boolean', 'is_invisible' => 'boolean']
$fillable
The attributes that are mass assignable.
protected
array<string|int, string>
$fillable
= ['id', 'user_name', 'full_name', 'first_name', 'last_name', 'total_friend', 'email', 'phone_number', 'password', 'is_featured', 'is_invisible', 'approve_status', 'updated_at', 'deleted_at', 'email_verified_at', 'phone_number_verified_at', 'verified_at']
$guard_name
This is use for roles, permissions. Please do not remove this.
protected
string
$guard_name
= 'api'
$hidden
The attributes that should be hidden for arrays.
protected
array<string|int, string>
$hidden
= ['password', 'remember_token']
$nestedAttributesFor
Defined nested attributes.
protected
array<string|int, mixed>
$nestedAttributesFor
= []
Methods
canBeBlocked()
Determine if resource can be blocked.
public
canBeBlocked() : bool
Return values
boolcheckContentShareable()
public
checkContentShareable(User $user[, Content $content = null ]) : bool
Parameters
Tags
Return values
boolcheckPostBy()
public
checkPostBy(User $user[, Content $content = null ]) : bool
Parameters
Return values
boolcustomProfile()
public
customProfile() : array<string|int, mixed>
Return values
array<string|int, mixed> —Get custom profile value
entityId()
public
entityId() : int
Return values
intentityType()
public
entityType() : string
Return values
stringfactory()
public
static factory(mixed $parameters) : UserFactory
Parameters
- $parameters : mixed
Return values
UserFactoryfill()
Fill the model with an array of attributes.
public
fill(array<string|int, mixed> $attributes) : static
Parameters
- $attributes : array<string|int, mixed>
Tags
Return values
staticfindForPassport()
Find the user instance for the given username.
public
findForPassport(string $username) : User|null
Can login by user_name, email Laravel/passport feature. Do not remove this.
Parameters
- $username : string
Tags
Return values
User|nullgetApprovedMessage()
public
getApprovedMessage() : string|null
Return values
string|nullgetDeclinedMessage()
public
getDeclinedMessage() : string|null
Return values
string|nullgetDefaultTabMenu()
public
getDefaultTabMenu() : string
Return values
stringgetDescriptionAttribute()
public
getDescriptionAttribute() : mixed
getEmailOptionForPasswordReset()
public
getEmailOptionForPasswordReset() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetFullNameAttribute()
public
getFullNameAttribute(string|null $value) : string
Parameters
- $value : string|null
Return values
stringgetFullNameRawAttribute()
public
getFullNameRawAttribute() : string
Return values
stringgetItemPrivacy()
public
getItemPrivacy() : int|null
Return values
int|nullgetNestedAttributesFor()
Get accept nested attributes.
public
getNestedAttributesFor() : array<string|int, mixed>
Return values
array<string|int, mixed>getOwnerAttribute()
public
getOwnerAttribute() : mixed
getOwnerEntityAttribute()
public
getOwnerEntityAttribute() : mixed
getPendingMessage()
public
getPendingMessage() : string|null
Return values
string|nullgetPhoneNumberOptionForPasswordReset()
public
getPhoneNumberOptionForPasswordReset() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetPrivacyPostBy()
Get privacy base on owner's requirement Page => 0 (public) Group => privacy_item User => 1 (friend).
public
getPrivacyPostBy() : int
Return values
intgetProfileAttribute()
public
getProfileAttribute() : mixed
getRepresentativePrivacy()
public
getRepresentativePrivacy() : int|null
Return values
int|nullgetRepresentativePrivacyDetail()
public
getRepresentativePrivacyDetail(int $privacy) : array<string|int, mixed>|null
Parameters
- $privacy : int
Return values
array<string|int, mixed>|nullgetResetMethods()
public
getResetMethods() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getRole()
public
getRole() : Role|null
Return values
Role|nullgetSharedFeedAvatarTypeIdAttribute()
public
getSharedFeedAvatarTypeIdAttribute() : string
Return values
stringgetSharedFeedCoverTypeIdAttribute()
public
getSharedFeedCoverTypeIdAttribute() : string
Return values
stringgetSmallestRoleId()
public
getSmallestRoleId() : int
Return values
intgetTotalCommentAttribute()
public
getTotalCommentAttribute() : int
Return values
intgetTotalReplyAttribute()
public
getTotalReplyAttribute() : int
Return values
intgetUserAttribute()
public
getUserAttribute() : mixed
getUserDescription()
public
getUserDescription() : string
Return values
stringgetUserEntityAttribute()
public
getUserEntityAttribute() : mixed
hasAdminRole()
public
hasAdminRole() : bool
Return values
boolhasContentPrivacy()
public
hasContentPrivacy() : bool
Return values
boolhasEmailAddress()
Check if the user has an associated email address.
public
hasEmailAddress() : bool
Return values
boolhasFeedDetailPage()
public
hasFeedDetailPage() : bool
Return values
boolhasNamedNotification()
public
hasNamedNotification() : null|string
Tags
Return values
null|stringhasPendingMode()
public
hasPendingMode() : bool
Return values
boolhasPermissionValue()
public
hasPermissionValue(mixed $permission) : bool
Parameters
- $permission : mixed
Return values
boolhasPhoneNumber()
Check if the user has an associated phone number.
public
hasPhoneNumber() : bool
Return values
boolhasRemoveFeed()
public
hasRemoveFeed(User $user[, Content $content = null ]) : bool
Parameters
Tags
Return values
boolhasRole()
public
hasRole(mixed $roles[, string $guard = null ]) : bool
Parameters
- $roles : mixed
- $guard : string = null
Return values
boolhasStaffRole()
public
hasStaffRole() : bool
Return values
boolhasSuperAdminRole()
public
hasSuperAdminRole() : bool
Return values
boolhasValuePermissionViaRole()
public
hasValuePermissionViaRole(Permission $permission) : bool
Parameters
- $permission : Permission
Return values
boolhasVerified()
Determine if the user has verified their account.
public
hasVerified() : bool
Return values
boolisApproved()
public
isApproved() : bool
Return values
boolisDeleted()
public
isDeleted() : bool
Return values
boolisGuest()
public
isGuest() : bool
Return values
boolisNotApproved()
public
isNotApproved() : bool
Return values
boolisPendingMode()
public
isPendingMode() : bool|null
Return values
bool|nullisTaggingAllowed()
public
isTaggingAllowed() : bool
Tags
Return values
boolmarkAsVerified()
Mark the user as verified.
public
markAsVerified() : void
mustVerify()
Check whether the user needs to verify their registered email / phone number.
public
mustVerify() : bool
Return values
boolmustVerifyEmailAddress()
Check whether the user needs to verify their email address.
public
mustVerifyEmailAddress() : bool
Return values
boolmustVerifyPhoneNumber()
Check whether the user needs to verify their phone number.
public
mustVerifyPhoneNumber() : bool
Return values
boolnotificationEmail()
public
notificationEmail() : string
Return values
stringnotificationFullName()
public
notificationFullName() : string
Return values
stringnotificationPhoneNumber()
public
notificationPhoneNumber() : string
Return values
stringnotificationUserName()
public
notificationUserName() : string
Return values
stringnotify()
Send the given notification.
public
notify(mixed $instance) : void
Parameters
- $instance : mixed
notifyNow()
Send the given notification immediately.
public
notifyNow(mixed $instance) : void
Parameters
- $instance : mixed
owner()
public
owner() : mixed
ownerEntity()
public
ownerEntity() : mixed
ownerId()
public
ownerId() : int
Return values
intownerType()
public
ownerType() : string
Return values
stringpreferredLocale()
public
preferredLocale() : string|null
Return values
string|nullprofile()
public
profile() : HasOne
Return values
HasOneresetTokens()
public
resetTokens() : HasMany
Return values
HasManyrevokeAllTokens()
public
revokeAllTokens() : void
routeNotificationFor()
Get the notification routing information for the given driver.
public
routeNotificationFor(string $driver, Notification $notification) : mixed
Parameters
- $driver : string
- $notification : Notification
save()
Save the model to the database.
public
save([array<string|int, mixed> $options = [] ]) : bool
Parameters
- $options : array<string|int, mixed> = []
Tags
Return values
boolsendPasswordResetNotification()
Send the password reset notification.
public
sendPasswordResetNotification(string $token) : void
Parameters
- $token : string
sendPasswordResetToken()
public
sendPasswordResetToken(PasswordResetToken $token[, string $channel = 'mail' ][, string $as = 'token' ]) : void
Parameters
- $token : PasswordResetToken
- $channel : string = 'mail'
- $as : string = 'token'
shouldVerifyEmailAddress()
Check whether the user should to verify their email address.
public
shouldVerifyEmailAddress() : bool
Return values
boolshouldVerifyPhoneNumber()
Check whether the user should to verify their phone number.
public
shouldVerifyPhoneNumber() : bool
Return values
boolsyncHasManyRelationAttribute()
Save the hasMany nested relation attributes to the database.
public
syncHasManyRelationAttribute(HasMany $relation, array<string|int, mixed> $params) : bool
Parameters
- $relation : HasMany
- $params : array<string|int, mixed>
Return values
boolsyncHasOneRelationAttribute()
public
syncHasOneRelationAttribute(HasOne $relation, array<string|int, mixed> $params) : bool
Parameters
- $relation : HasOne
- $params : array<string|int, mixed>
Return values
booltoActivityFeed()
public
toActivityFeed() : FeedAction|null
Return values
FeedAction|nulltoActivitySubscription()
This method must return [$userId, $ownerId] $userId: who subscribe $ownerId: whom subscribe from When $owner post content on profile, $userId can see $owner feed.
public
toActivitySubscription() : array<string|int, int>
Return values
array<string|int, int>toApprovedNotification()
public
toApprovedNotification() : array<string|int, mixed>
Return values
array<string|int, mixed>toDeclinedContentLink()
public
toDeclinedContentLink() : string|null
Return values
string|nulltoDeclinedContentUrl()
public
toDeclinedContentUrl() : string|null
Return values
string|nulltoLink()
public
toLink() : string|null
Return values
string|nulltoOGDescription()
public
toOGDescription([User|null $context = null ]) : string|null
Parameters
- $context : User|null = null
Return values
string|nulltoPaymentSettingUrl()
public
toPaymentSettingUrl() : string
Return values
stringtoPrivacyItem()
Result [ [$userId, $itemId, $itemType, $privacyType] ] $userId: to Insert into privacy_data $itemId: $itemType, $privacyType: to find privacy_id.
public
toPrivacyItem() : array<string|int, mixed>
Return values
array<string|int, mixed>toPrivacyLists()
public
toPrivacyLists() : array<string|int, mixed>
Return values
array<string|int, mixed>toRouter()
public
toRouter() : string|null
Return values
string|nulltoSearchable()
public
toSearchable() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nulltoSitemapUrl()
public
toSitemapUrl() : string|null
Return values
string|nulltoTitle()
public
toTitle() : string
Return values
stringtoUrl()
public
toUrl() : string|null
Return values
string|nulltoUserResource()
public
toUserResource() : array<string, mixed>
Return values
array<string, mixed>transformRole()
public
transformRole() : string
Return values
stringuser()
public
user() : mixed
userActivity()
public
userActivity() : HasOne
Return values
HasOneuserEntity()
public
userEntity() : mixed
userId()
public
userId() : int
Return values
intuserType()
public
userType() : string
Return values
stringvalidateForPassportPasswordGrant()
public
validateForPassportPasswordGrant(string $input) : bool
Parameters
- $input : string
Return values
boolvalidatePassword()
public
validatePassword(mixed $input) : bool
Parameters
- $input : mixed
Return values
boolallowDestroyNestedAttributes()
Check can we delete nested data.
protected
allowDestroyNestedAttributes(array<string|int, mixed> $params) : bool
Parameters
- $params : array<string|int, mixed>
Return values
boolnewFactory()
protected
static newFactory() : UserFactory
Return values
UserFactorynormalizeRoles()
private
normalizeRoles(mixed $roles) : array<string|int, mixed>
Parameters
- $roles : mixed