laravel - Issue in window.Echo -
i following this tutorial implement pusher in laravel 5.4
below step step things done.
composer require pusher/pusher-php-server
npm install --save laravel-echo pusher-js
- instantiated echo instance in
resources/assets/js/bootstrap.js
- initialized pusher key in
env
, inbootstrap.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
Post a Comment