Skip to main content
Version: v1.0-alpha.3

ChatEvent APIs

Namespace#

Myckhel\ChatSystem\Models\ChatEvent

Columns#

nametypedescription
maker_idintid of the model making event
maker_typestringclass of the model making event
made_idintid of the model making event from
made_typestringclass of the model making event from
typeenum(read, delete, deliver)the type of the event
allboolwhether event was made for all participant

Query Builders#

Methods that build queries.

withAll()#

adds query where maker is the given user or chat event is for all participants.

@Params#

  • user | user to retrive chat events for. | ChatEventMaker
ChatEvent::withAll($user)->get();

notMessenger()#

adds query where the chat event message sender is not the given user.

@Params#

  • user | user that should not be the chat event message sender. | ChatEventMaker|int
ChatEvent::notMessenger($user)->first();

Relationships#

These are methods that defines the relationship between models.

message()#

ChatEvent belongs to a message.

$chatEvent->message;

conversation()#

ChatEvent belongs to a conversation.

$chatEvent->conversation;

maker()#

ChatEvent morph to maker models.

$chatEvent->maker;

made()#

ChatEvent morph to made models.

$chatEvent->made;