\App\EventsMessageReceived

MessageReceived event that can be broadcast to the frontend

Summary

Methods
Properties
Constants
__construct()
broadcastOn()
broadcastWith()
No public properties found
No constants found
getConversationChannel()
$message
$user
N/A
No private methods found
No private properties found
N/A

Properties

$user

$user : \App\User

User that received the message

Type

\App\User

Methods

__construct()

__construct(\App\Message  $message, \App\User  $user) 

Create a new event instance.

Parameters

\App\Message $message
\App\User $user

User that received the message

broadcastOn()

broadcastOn() : \Illuminate\Broadcasting\Channel|array

Get the channels the event should broadcast on.

Returns

\Illuminate\Broadcasting\Channel|array

broadcastWith()

broadcastWith() : array

Get the data to broadcast.

Returns

array

getConversationChannel()

getConversationChannel(string  $username1, string  $username2) : \Illuminate\Broadcasting\PrivateChannel

Get the name of a conversation channel between two users.

Parameters

string $username1
string $username2

Returns

\Illuminate\Broadcasting\PrivateChannel