ChatEvent APIs
#
NamespaceMyckhel\ChatSystem\Models\ChatEvent
#
Columnsname | type | description |
---|---|---|
maker_id | int | id of the model making event |
maker_type | string | class of the model making event |
made_id | int | id of the model making event from |
made_type | string | class of the model making event from |
type | enum(read, delete, deliver) | the type of the event |
all | bool | whether event was made for all participant |
#
Query BuildersMethods that build queries.
withAll()
#
adds query where maker is the given user or chat event is for all participants.
#
@Paramsuser
| 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.
#
@Paramsuser
| user that should not be the chat event message sender. |ChatEventMaker|int
ChatEvent::notMessenger($user)->first();
#
RelationshipsThese 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;