{"id":2470,"date":"2025-07-18T09:16:13","date_gmt":"2025-07-18T09:16:13","guid":{"rendered":"https:\/\/itnotes.apjsoftwares.in\/?p=2470"},"modified":"2025-07-18T09:16:13","modified_gmt":"2025-07-18T09:16:13","slug":"what-is-laravel-echo","status":"publish","type":"post","link":"https:\/\/itnotes.apjsoftwares.in\/index.php\/2025\/07\/18\/what-is-laravel-echo\/","title":{"rendered":"What is Laravel Echo?"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">\ud83d\udd38 <strong>English:<\/strong><\/h4>\n\n\n\n<p>Laravel Echo is like a <strong>listener<\/strong> on the frontend. When something happens on the server (like a new message, order placed, or status updated), Echo listens for that event and updates the UI <strong>instantly<\/strong> \u2014 without refreshing the page.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\ud83d\udd38 <strong>Hindi:<\/strong><\/h4>\n\n\n\n<p>Laravel Echo \u090f\u0915 JavaScript \u0932\u093e\u0907\u092c\u094d\u0930\u0947\u0930\u0940 \u0939\u0948 \u091c\u094b <strong>real-time events \u0915\u094b browser \u092e\u0947\u0902 \u0938\u0941\u0928\u0924\u0940 \u0939\u0948<\/strong>\u0964 \u091c\u0948\u0938\u0947 \u0939\u0940 server \u092a\u0930 \u0915\u094b\u0908 event trigger \u0939\u094b\u0924\u093e \u0939\u0948 (\u091c\u0948\u0938\u0947 \u0928\u092f\u093e \u092e\u0948\u0938\u0947\u091c \u0906\u092f\u093e, order confirm \u0939\u0941\u0906), Echo \u0909\u0938\u0947 \u092a\u0915\u0921\u093c\u0924\u093e \u0939\u0948 \u0914\u0930 \u092a\u0947\u091c \u0915\u094b reload \u0915\u093f\u090f \u092c\u093f\u0928\u093e UI \u0915\u094b update \u0915\u0930 \u0926\u0947\u0924\u093e \u0939\u0948\u0964<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 <strong>Real-World Example:<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\ud83c\udfaf Use Case:<\/h4>\n\n\n\n<p>You have a <strong>chat application<\/strong> built in Laravel. When User A sends a message, User B should see it immediately <strong>without refreshing<\/strong>.<\/p>\n\n\n\n<p>Laravel Echo lets you do that by:<\/p>\n\n\n\n<ol>\n<li>Broadcasting the message from Laravel backend.<\/li>\n\n\n\n<li>Listening for the event using Echo in frontend.<\/li>\n\n\n\n<li>Automatically updating the chat window.<\/li>\n<\/ol>\n\n\n\n<ol start=\"3\">\n<li><strong>Listen on Frontend (using Echo in JavaScript)<\/strong><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">jsCopyEdit<code>import Echo from 'laravel-echo';\n\nwindow.Pusher = require('pusher-js');\n\nwindow.Echo = new Echo({\n    broadcaster: 'pusher',\n    key: 'your-pusher-key',\n    cluster: 'mt1',\n    forceTLS: true\n});\n\nEcho.channel('chat')\n    .listen('NewMessage', (e) =&gt; {\n        console.log(e.message);\n    });\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\ud83d\udd38 English: Laravel Echo is like a listener on the frontend. When something happens on&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[36],"tags":[],"_links":{"self":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/2470"}],"collection":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/comments?post=2470"}],"version-history":[{"count":1,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/2470\/revisions"}],"predecessor-version":[{"id":2471,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/2470\/revisions\/2471"}],"wp:attachment":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/media?parent=2470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/categories?post=2470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/tags?post=2470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}