laravel - Issue in window.Echo -


i following this tutorial implement pusher in laravel 5.4

below step step things done.

  1. composer require pusher/pusher-php-server
  2. npm install --save laravel-echo pusher-js
  3. instantiated echo instance in resources/assets/js/bootstrap.js
  4. initialized pusher key in env , in bootstrap.js file.

finally, wrote below code in blade.

<script>     debugger;     window.echo.channel('sendmessagechannel.1')         .listen('.app.events.sendmessageevent', (e) => {             console.log(e);         }); </script> 

also added <script src="{{ asset('js/app.js') }}"></script> reference in layout. while debugging, found window.echo undefined.

am missing anything?

once install laravel-echo , pusher-js, need run npm run dev app.js can have both libraries.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

.htaccess - ERR_TOO_MANY_REDIRECTS htaccess -