I have done all the steps for installing the laravel-echo-server, but when I want to dispatch an event it will not log into the server.. the laravel-echo-server shows the connected users but can not dispatch..
Here my codes
<?php
namespace App\Events;
use Illuminate\Broadcasting\Channel;
use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class Message implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $message;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct($message)
{
$this->message = $message;
}
/**
* Get the channels the event should broadcast on.
*
* @return \Illuminate\Broadcasting\Channel|array
*/
public function broadcastOn()
{
return new Channel('chat');
}
}
<?php
use App\Events\Message;
Route::get('/', function () {
return view('chat');
});
Route::post('/messages', function () {
Message::dispatch(request('body'));
});
I have done all the steps for installing the laravel-echo-server, but when I want to dispatch an event it will not log into the server.. the laravel-echo-server shows the connected users but can not dispatch..
Here my codes
Here my vue component
and that is the laravel-echo-server.json