laravel echo , broadcast , , redis configration

Posted 3 months ago by seantiago24

i'm starting a laravel project configuration , for chat app , so for that i'm using laravel-echo-server and and redis , no pusher .

i've configured all and it seems ok cause i'm not getting any errors in my chrome console , but i'm not getting any response , for now i'm just trying to console a random message ( console.log('test ok') ) and still not getting it . route file web.php

Route::get('/', function () { return view('welcome'); });

Route::get('/event' , '[email protected]');

Controller tesController.php

public function event (){ Broadcast(new ExampleEvent('message de test')); return 'Broadcasted'; }

view file welcome.blade.php


    <!-- Fonts -->
    <link href=",600" rel="stylesheet">
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <div class="flex-center position-ref full-height">
        @if (Route::has('login'))
            <div class="top-right links">
                    <a href="{{ url('/home') }}">Home</a>
                    <a href="{{ route('login') }}">Login</a>

                    @if (Route::has('register'))
                        <a href="{{ route('register') }}">Register</a>

        <div id="app" class="content">
            <div class="title m-b-md">
    <script src="{{ asset('js/app.js') }}"></script>
    <script type="text/javascript">'testevent')
        .listen('ExampleEvent', (e) => {


{ "authHost": "http://localhost", "authEndpoint": "/broadcasting/auth", "clients": [], "database": "redis", "databaseConfig": { "redis": {}, "sqlite": { "databasePath": "/database/laravel-echo-server.sqlite" } }, "devMode": true, "host": null, "port": "6001", "protocol": "http", "socketio": {}, "sslCertPath": "", "sslKeyPath": "", "sslCertChainPath": "", "sslPassphrase": "", "subscribers": { "http": true, "redis": true }, "apiOriginAllow": { "allowCors": false, "allowOrigin": "", "allowMethods": "", "allowHeaders": "" } }

and i've added this in bootstrap file

import Echo from 'laravel-echo' = require(''); = require(''); window.Echo = new Echo({ broadcaster: '', host: 'localhost:6001' });

the Event file :

class ExampleEvent implements ShouldBroadcast {

public $message;
use Dispatchable, InteractsWithSockets, SerializesModels;

 * 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('testevent');

public function broadcastWith()

    return [
        'data' => 'key'


and yes i've already started laravel-echo-server start and installed all the packages needed (predis , ...) and redis is lunched and working .. i've uncommented the line of broadcastProvider in app.php

in the cmd that started the laravel-echo server it shows that an event is fired , but not in redis .. that'sthe message :

[00:50:54] - LkC1zwJemGYIVcI1AAAA joined channel: testevent Channel: laravel_database_testevent Event: App\Events\ExampleEvent

as i said i'm just testing to console any random message to continue working and the other treatment , but not getting any thing in the console , no errors , no response ..

any body know whyy

Please sign in or create an account to participate in this conversation.