FriendRequest
        
        extends Model
    
    
            
            in package
            
        
    
            
            implements
                            Entity,                             IsNotifyInterface,                             HasUrl                    
    
            
            Uses
                            HasEntity,                             HasOwnerMorph,                             HasUserMorph,                             HasFactory                    
    
Class FriendRequest.
Tags
Table of Contents
Interfaces
- Entity
 - Interface Entity.
 - IsNotifyInterface
 - Interface Entity.
 - HasUrl
 
Constants
- ACTION_APPROVE = 'approve'
 - ACTION_DENY = 'deny'
 - ENTITY_TYPE = 'friend_request'
 - IS_DENY = 1
 - IS_SEEN = 1
 
Properties
- $created_at : string
 - $id : int
 - $is_deny : int
 - $is_ignore : bool
 - $is_seen : bool
 - $owner : User
 - $status_id : int
 - $updated_at : string
 - $user : User
 - $appends : array<string|int, string>
 - $fillable : mixed
 - $table : mixed
 
Methods
- entityId() : int
 - entityType() : string
 - factory() : FriendRequestFactory
 - getIsIgnoreAttribute() : bool
 - getIsSeenAttribute() : bool
 - getOwnerAttribute() : mixed
 - getOwnerEntityAttribute() : mixed
 - getUserAttribute() : mixed
 - getUserEntityAttribute() : mixed
 - isOwner() : bool
 - check if $user is the owner of entity.
 - isUser() : bool
 - check if $user is the user (creator) of entity.
 - moduleName() : string
 - owner() : MorphTo
 - ownerEntity() : BelongsTo
 - ownerId() : int
 - ownerType() : string
 - toLink() : string|null
 - toNotification() : array<int, mixed>
 - creator result must contain User owner.
 - toRouter() : string|null
 - toUrl() : string|null
 - user() : MorphTo
 - userEntity() : BelongsTo
 - userId() : int
 - userType() : string
 - newFactory() : FriendRequestFactory
 
Constants
ACTION_APPROVE
    public
        mixed
    ACTION_APPROVE
    = 'approve'
    
    
    
ACTION_DENY
    public
        mixed
    ACTION_DENY
    = 'deny'
    
    
    
ENTITY_TYPE
    public
        mixed
    ENTITY_TYPE
    = 'friend_request'
    
    
    
IS_DENY
    public
        mixed
    IS_DENY
    = 1
    
    
    
IS_SEEN
    public
        mixed
    IS_SEEN
    = 1
    
    
    
Properties
$created_at
    public
        string
    $created_at
    
    
    
    
$id
    public
        int
    $id
    
    
    
    
$is_deny
    public
        int
    $is_deny
    
    
    
    
$is_ignore
    public
        bool
    $is_ignore
    
    
    
    
$is_seen
    public
        bool
    $is_seen
    
    
    
    
$owner
    public
        User
    $owner
    
    
    
    
$status_id
    public
        int
    $status_id
    
    
    
    
$updated_at
    public
        string
    $updated_at
    
    
    
    
$user
    public
        User
    $user
    
    
    
    
$appends
    protected
        array<string|int, string>
    $appends
     = ['is_seen', 'is_ignore']
    
    
    
$fillable
    protected
        mixed
    $fillable
     = ['user_id', 'user_type', 'owner_type', 'owner_id', 'status_id', 'is_deny']
    
    
    
$table
    protected
        mixed
    $table
     = 'friend_requests'
    
    
    
Methods
entityId()
    public
                    entityId() : int
    Return values
intentityType()
    public
                    entityType() : string
    Return values
stringfactory()
    public
            static        factory() : FriendRequestFactory
    Return values
FriendRequestFactorygetIsIgnoreAttribute()
    public
                    getIsIgnoreAttribute() : bool
    Return values
boolgetIsSeenAttribute()
    public
                    getIsSeenAttribute() : bool
    Return values
boolgetOwnerAttribute()
    public
                    getOwnerAttribute() : mixed
    getOwnerEntityAttribute()
    public
                    getOwnerEntityAttribute() : mixed
    getUserAttribute()
    public
                    getUserAttribute() : mixed
    getUserEntityAttribute()
    public
                    getUserEntityAttribute() : mixed
    isOwner()
check if $user is the owner of entity.
    public
                    isOwner(User $user) : bool
    Parameters
- $user : User
 
Return values
boolisUser()
check if $user is the user (creator) of entity.
    public
                    isUser(User $user) : bool
    Parameters
- $user : User
 
Return values
boolmoduleName()
    public
                    moduleName() : string
    Return values
stringowner()
    public
                    owner() : MorphTo
    Return values
MorphToownerEntity()
    public
                    ownerEntity() : BelongsTo
    Return values
BelongsToownerId()
    public
                    ownerId() : int
    Return values
intownerType()
    public
                    ownerType() : string
    Return values
stringtoLink()
    public
                    toLink() : string|null
    Return values
string|nulltoNotification()
creator result must contain User owner.
    public
                    toNotification() : array<int, mixed>
    Return values
array<int, mixed>toRouter()
    public
                    toRouter() : string|null
    Return values
string|nulltoUrl()
    public
                    toUrl() : string|null
    Return values
string|nulluser()
    public
                    user() : MorphTo
    Return values
MorphTouserEntity()
    public
                    userEntity() : BelongsTo
    Return values
BelongsTouserId()
    public
                    userId() : int
    Return values
intuserType()
    public
                    userType() : string
    Return values
stringnewFactory()
    protected
            static        newFactory() : FriendRequestFactory