Se corrigen bugs de chat en tiempo real
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use Illuminate\Broadcasting\PrivateChannel;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
|
||||
class UserTyping implements ShouldBroadcast
|
||||
{
|
||||
public $conversationId;
|
||||
public $user;
|
||||
|
||||
public function __construct($conversationId, $user)
|
||||
{
|
||||
$this->conversationId = $conversationId;
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
public function broadcastOn()
|
||||
{
|
||||
return new PrivateChannel('chat.' . $this->conversationId);
|
||||
}
|
||||
|
||||
public function broadcastAs()
|
||||
{
|
||||
return 'UserTyping';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user