Attachment
extends Model
in package
Uses
HasEntity, HasFactory, HasUserMorph, HasOwnerMorph
Class Attachment.
Tags
Table of Contents
Constants
- ENTITY_TYPE = 'attachment'
Properties
- $content : string
- $id : int
- $items : Collection|array<string|int, AttachmentData>
- $owner_id : int
- $owner_type : string
- $privacy : int
- $total_comment : int
- $total_item : int
- $total_like : int
- $total_share : int
- $user_id : int
- $user_type : string
- $fillable : array<string|int, string>
- $table : mixed
Methods
- entityId() : int
- entityType() : string
- factory() : AttachmentFactory
- 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.
- items() : HasMany
- moduleName() : string
- owner() : MorphTo
- ownerEntity() : BelongsTo
- ownerId() : int
- ownerType() : string
- user() : MorphTo
- userEntity() : BelongsTo
- userId() : int
- userType() : string
Constants
ENTITY_TYPE
public
mixed
ENTITY_TYPE
= 'attachment'
Properties
$content
public
string
$content
$id
public
int
$id
$items
public
Collection|array<string|int, AttachmentData>
$items
$owner_id
public
int
$owner_id
$owner_type
public
string
$owner_type
$privacy
public
int
$privacy
$total_comment
public
int
$total_comment
$total_item
public
int
$total_item
$total_like
public
int
$total_like
$total_share
public
int
$total_share
$user_id
public
int
$user_id
$user_type
public
string
$user_type
$fillable
protected
array<string|int, string>
$fillable
= ['user_id', 'user_type', 'owner_id', 'owner_type', 'privacy', 'total_like', 'total_comment', 'total_share', 'total_item', 'content']
$table
protected
mixed
$table
= 'activity_attachments'
Methods
entityId()
public
entityId() : int
Return values
intentityType()
public
entityType() : string
Return values
stringfactory()
public
static factory([array<string, mixed> $parameters = [] ]) : AttachmentFactory
Parameters
- $parameters : array<string, mixed> = []
Return values
AttachmentFactorygetOwnerAttribute()
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
boolitems()
public
items() : HasMany
Return values
HasManymoduleName()
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
stringuser()
public
user() : MorphTo
Return values
MorphTouserEntity()
public
userEntity() : BelongsTo
Return values
BelongsTouserId()
public
userId() : int
Return values
intuserType()
public
userType() : string