Notification
extends Model
in package
implements
Entity
Uses
HasFactory, HasEntity, HasItemMorph, HasUserMorph, SoftDeletes
Class Notification.
Tags
Table of Contents
Interfaces
- Entity
- Interface Entity.
Constants
- ENTITY_TYPE = 'notification'
Properties
- $created_at : mixed
- $data : array<string|int, mixed>
- $data_item_id : int
- $data_item_type : string
- $id : int
- $incrementing : mixed
- $is_notified : bool
- $is_read : bool
- $item_id : int
- $item_type : string
- $notifiable : IsNotifiable|null
- $notifiable_id : int
- $notifiable_type : string
- $notified_at : mixed
- $read_at : mixed
- $type : string
- $updated_at : mixed
- $user_id : int
- $user_type : string
- $appends : array<string|int, string>
- $casts : array<string|int, string>
- $fillable : mixed
- $keyType : mixed
- $primaryKey : mixed
- $table : mixed
Methods
- entityId() : int
- entityType() : string
- factory() : NotificationFactory
- getIsNotifiedAttribute() : bool
- getIsReadAttribute() : bool
- getItemAttribute() : mixed
- getUserAttribute() : mixed
- getUserEntityAttribute() : mixed
- isUser() : bool
- check if $user is the user (creator) of entity.
- item() : MorphTo|null
- itemId() : int
- itemType() : string
- moduleName() : string
- notifiable() : MorphTo
- user() : MorphTo
- userEntity() : BelongsTo
- userId() : int
- userType() : string
- newFactory() : NotificationFactory
Constants
ENTITY_TYPE
public
mixed
ENTITY_TYPE
= 'notification'
Properties
$created_at
public
mixed
$created_at
$data
public
array<string|int, mixed>
$data
$data_item_id
public
int
$data_item_id
$data_item_type
public
string
$data_item_type
$id
public
int
$id
$incrementing
public
mixed
$incrementing
= true
$is_notified
public
bool
$is_notified
$is_read
public
bool
$is_read
$item_id
public
int
$item_id
$item_type
public
string
$item_type
$notifiable
public
IsNotifiable|null
$notifiable
$notifiable_id
public
int
$notifiable_id
$notifiable_type
public
string
$notifiable_type
$notified_at
public
mixed
$notified_at
$read_at
public
mixed
$read_at
$type
public
string
$type
$updated_at
public
mixed
$updated_at
$user_id
public
int
$user_id
$user_type
public
string
$user_type
$appends
protected
array<string|int, string>
$appends
= ['is_notified', 'is_read']
$casts
protected
array<string|int, string>
$casts
= ['data' => 'array']
$fillable
protected
mixed
$fillable
= ['id', 'notifiable_id', 'notifiable_type', 'item_id', 'item_type', 'data_item_id', 'data_item_type', 'user_id', 'user_type', 'data', 'type', 'is_request', 'notified_at', 'read_at']
$keyType
protected
mixed
$keyType
= 'string'
$primaryKey
protected
mixed
$primaryKey
= 'id'
$table
protected
mixed
$table
= 'notifications'
Methods
entityId()
public
entityId() : int
Return values
intentityType()
public
entityType() : string
Return values
stringfactory()
public
static factory(mixed $parameters) : NotificationFactory
Parameters
- $parameters : mixed
Return values
NotificationFactorygetIsNotifiedAttribute()
public
getIsNotifiedAttribute() : bool
Return values
boolgetIsReadAttribute()
public
getIsReadAttribute() : bool
Return values
boolgetItemAttribute()
public
getItemAttribute() : mixed
getUserAttribute()
public
getUserAttribute() : mixed
getUserEntityAttribute()
public
getUserEntityAttribute() : mixed
isUser()
check if $user is the user (creator) of entity.
public
isUser(User $user) : bool
Parameters
- $user : User
Return values
boolitem()
public
item() : MorphTo|null
Return values
MorphTo|nullitemId()
public
itemId() : int
Return values
intitemType()
public
itemType() : string
Return values
stringmoduleName()
public
moduleName() : string
Return values
stringnotifiable()
public
notifiable() : MorphTo
Return values
MorphTouser()
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() : NotificationFactory