{"id":4172,"date":"2021-01-16T09:33:07","date_gmt":"2021-01-16T09:33:07","guid":{"rendered":"https:\/\/infyblog.zluck.in\/?p=4172"},"modified":"2024-08-12T07:17:37","modified_gmt":"2024-08-12T07:17:37","slug":"send-real-time-notification-with-pusher-using-laravel-and-javascript","status":"publish","type":"post","link":"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/","title":{"rendered":"Send real time notification with Pusher using Laravel and Javascript"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"4172\" class=\"elementor elementor-4172\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-166810f elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"166810f\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-2f71ad0\" data-id=\"2f71ad0\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\n\t\t<div class=\"elementor-element elementor-element-ce1ce6d elementor-widget elementor-widget-text-editor\" data-id=\"ce1ce6d\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Here we will learn how to send real-time notifications using Pusher + Laravel.<\/p><p>First of all, you need to create an account in the Pusher and get API keys from there.<\/p><h2>Setting up your Laravel application<\/h2><p>Now we need to install Pusher SDK, you can install it by the composer using the below command,<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-841aa38 elementor-widget elementor-widget-code-highlight\" data-id=\"841aa38\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>composer require pusher\/pusher-php-server<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2dfc2a0 elementor-widget elementor-widget-text-editor\" data-id=\"2dfc2a0\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>After the composer is done, we will need to configure Laravel to use Pusher as its broadcast driver, update the below variables in the .env file,<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0b89183 elementor-widget elementor-widget-code-highlight\" data-id=\"0b89183\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>PUSHER_APP_ID=123456\r\nBROADCAST_DRIVER=pusher<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-78d4a87 elementor-widget elementor-widget-text-editor\" data-id=\"78d4a87\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>\/\/ Get the API Keys from your pusher dashboard<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-00de36c elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"00de36c\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-62cfa4f\" data-id=\"62cfa4f\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-a3a1476 elementor-widget elementor-widget-code-highlight\" data-id=\"a3a1476\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>PUSHER_APP_ID=XXXXX\r\nPUSHER_APP_KEY=XXXXXXX\r\nPUSHER_APP_SECRET=XXXXXXX<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-058679f elementor-widget elementor-widget-text-editor\" data-id=\"058679f\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Open config\/app.phpand uncomment the &#8220;App\\Providers\\BroadcastServiceProvider::class&#8221;.<\/p><p>Now we need an event that will be broadcast to the pusher driver. Let&#8217;s create a NotificationEvent.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-230cf1f elementor-widget elementor-widget-code-highlight\" data-id=\"230cf1f\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>php artisan make:event NotificationEvent<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-816f300 elementor-widget elementor-widget-text-editor\" data-id=\"816f300\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>This command will create a below file<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f119abc elementor-widget elementor-widget-code-highlight\" data-id=\"f119abc\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>namespace App\\Events;\r\nuse Illuminate\\Queue\\SerializesModels;\r\nuse Illuminate\\Foundation\\Events\\Dispatchable;\r\nuse Illuminate\\Broadcasting\\InteractsWithSockets;\r\nuse Illuminate\\Contracts\\Broadcasting\\ShouldBroadcast;\r\nclass NotificationEvent implements ShouldBroadcast\r\n{\r\n    use Dispatchable, InteractsWithSockets, SerializesModels;\r\n    public $username;\r\n    public $message;\r\n    public function __construct($username)\r\n    {\r\n        $this->username = $username;\r\n        $this->message  = \"{$username} send you a notification\";\r\n    }\r\n    public function broadcastOn()\r\n    {\r\n        \/\/it is a broadcasting channel you need to add this route in channels.php file\r\n        return ['notification-send'];\r\n    }\r\n}<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d8e917b elementor-widget elementor-widget-text-editor\" data-id=\"d8e917b\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Add broadcasting route in channels.php file<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8366575 elementor-widget elementor-widget-code-highlight\" data-id=\"8366575\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>Broadcast::channel('notification-send', function ($user) {\r\n    return true;\r\n}); <\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a5884e1 elementor-widget elementor-widget-text-editor\" data-id=\"a5884e1\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<h2>Cache Event at Javascript Side<\/h2><p>\/\/ Initiate the Pusher JS library<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-09e99ee elementor-widget elementor-widget-code-highlight\" data-id=\"09e99ee\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>var pusher = new Pusher('YOUR_API_KEY', {\r\n    encrypted: true\r\n});<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0dcbc88 elementor-widget elementor-widget-text-editor\" data-id=\"0dcbc88\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>\/\/ Subscribe to the channel we used in our Laravel Event<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-39b1829 elementor-widget elementor-widget-code-highlight\" data-id=\"39b1829\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>var channel = pusher.subscribe('notification-send');\r\nchannel.bind('App\\\\Events\\\\NotificationEvent', function(data) {\r\n    \/\/ this is called when the event notification is received...\r\n});<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7827567 elementor-widget elementor-widget-text-editor\" data-id=\"7827567\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<h2>Testing and Setup<\/h2><p>Using the below route we can send a notification.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-46e663e elementor-widget elementor-widget-code-highlight\" data-id=\"46e663e\" data-element_type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"prismjs-default copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-javascript \">\n\t\t\t\t<code readonly=\"true\" class=\"language-javascript\">\n\t\t\t\t\t<xmp>Route::get('test', function () {\r\n    event(new App\\Events\\NotificationEvent('Monika'));\r\n    return \"Event has been sent!\";\r\n});<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t\n    <div class=\"xs_social_share_widget xs_share_url after_content \t\tmain_content  wslu-style-1 wslu-share-box-shaped wslu-fill-colored wslu-none wslu-share-horizontal wslu-theme-font-no wslu-main_content\">\n\n\t\t\n        <ul>\n\t\t\t        <\/ul>\n    <\/div> \n","protected":false},"excerpt":{"rendered":"<p>Send real time notification with Pusher using Laravel and Javascript<\/p>\n","protected":false},"author":2,"featured_media":4174,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"postBodyCss":"","postBodyMargin":[],"postBodyPadding":[],"postBodyBackground":{"backgroundType":"classic","gradient":""},"two_page_speed":[],"footnotes":""},"categories":[9],"tags":[132,131],"class_list":["post-4172","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-notification","tag-pusher"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Send real time notification with Pusher using Laravel and Javascript<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Send real time notification with Pusher using Laravel and Javascript\" \/>\n<meta property=\"og:description\" content=\"Send real time notification with Pusher using Laravel and Javascript\" \/>\n<meta property=\"og:url\" content=\"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog | InfyOm Technologies\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/infyom\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-16T09:33:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-12T07:17:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/07\/send-real-time-notification-with-pusher-using-laravel-and-javascript-1-1-1-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"772\" \/>\n\t<meta property=\"og:image:height\" content=\"484\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"InfyOm\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InfyOm\" \/>\n<meta name=\"twitter:site\" content=\"@InfyOm\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InfyOm\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/\"},\"author\":{\"name\":\"InfyOm\",\"@id\":\"https:\/\/infyom.com\/blog\/#\/schema\/person\/659bfc844c333d041221e83c5f5ec754\"},\"headline\":\"Send real time notification with Pusher using Laravel and Javascript\",\"datePublished\":\"2021-01-16T09:33:07+00:00\",\"dateModified\":\"2024-08-12T07:17:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/\"},\"wordCount\":169,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/infyom.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/07\/send-real-time-notification-with-pusher-using-laravel-and-javascript-1-1-1-1.png\",\"keywords\":[\"Notification\",\"Pusher\"],\"articleSection\":[\"Laravel\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/\",\"url\":\"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/\",\"name\":\"Send real time notification with Pusher using Laravel and Javascript\",\"isPartOf\":{\"@id\":\"https:\/\/infyom.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/07\/send-real-time-notification-with-pusher-using-laravel-and-javascript-1-1-1-1.png\",\"datePublished\":\"2021-01-16T09:33:07+00:00\",\"dateModified\":\"2024-08-12T07:17:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/#primaryimage\",\"url\":\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/07\/send-real-time-notification-with-pusher-using-laravel-and-javascript-1-1-1-1.png\",\"contentUrl\":\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/07\/send-real-time-notification-with-pusher-using-laravel-and-javascript-1-1-1-1.png\",\"width\":772,\"height\":484,\"caption\":\"Send real time notification with Pusher using Laravel and Javascript\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/infyom.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Send real time notification with Pusher using Laravel and Javascript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/infyom.com\/blog\/#website\",\"url\":\"https:\/\/infyom.com\/blog\/\",\"name\":\"Blog | InfyOm Technologies\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/infyom.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/infyom.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/infyom.com\/blog\/#organization\",\"name\":\"InfyOm Technologies\",\"url\":\"https:\/\/infyom.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/infyom.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/06\/InfyOm-Logo.png\",\"contentUrl\":\"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/06\/InfyOm-Logo.png\",\"width\":88,\"height\":41,\"caption\":\"InfyOm Technologies\"},\"image\":{\"@id\":\"https:\/\/infyom.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/infyom\",\"https:\/\/x.com\/InfyOm\",\"https:\/\/www.instagram.com\/infyomtechnologies\/\",\"https:\/\/in.linkedin.com\/company\/infyom-technologies\",\"https:\/\/github.com\/infyomlabs\",\"https:\/\/x.com\/infyom\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/infyom.com\/blog\/#\/schema\/person\/659bfc844c333d041221e83c5f5ec754\",\"name\":\"InfyOm\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/infyom.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1ad162864d8d33c04ea9e6d0333cc483?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1ad162864d8d33c04ea9e6d0333cc483?s=96&d=mm&r=g\",\"caption\":\"InfyOm\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Send real time notification with Pusher using Laravel and Javascript","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/","og_locale":"en_US","og_type":"article","og_title":"Send real time notification with Pusher using Laravel and Javascript","og_description":"Send real time notification with Pusher using Laravel and Javascript","og_url":"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/","og_site_name":"Blog | InfyOm Technologies","article_publisher":"https:\/\/www.facebook.com\/infyom","article_published_time":"2021-01-16T09:33:07+00:00","article_modified_time":"2024-08-12T07:17:37+00:00","og_image":[{"width":772,"height":484,"url":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/07\/send-real-time-notification-with-pusher-using-laravel-and-javascript-1-1-1-1.png","type":"image\/png"}],"author":"InfyOm","twitter_card":"summary_large_image","twitter_creator":"@InfyOm","twitter_site":"@InfyOm","twitter_misc":{"Written by":"InfyOm","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/#article","isPartOf":{"@id":"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/"},"author":{"name":"InfyOm","@id":"https:\/\/infyom.com\/blog\/#\/schema\/person\/659bfc844c333d041221e83c5f5ec754"},"headline":"Send real time notification with Pusher using Laravel and Javascript","datePublished":"2021-01-16T09:33:07+00:00","dateModified":"2024-08-12T07:17:37+00:00","mainEntityOfPage":{"@id":"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/"},"wordCount":169,"commentCount":0,"publisher":{"@id":"https:\/\/infyom.com\/blog\/#organization"},"image":{"@id":"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/07\/send-real-time-notification-with-pusher-using-laravel-and-javascript-1-1-1-1.png","keywords":["Notification","Pusher"],"articleSection":["Laravel"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/","url":"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/","name":"Send real time notification with Pusher using Laravel and Javascript","isPartOf":{"@id":"https:\/\/infyom.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/#primaryimage"},"image":{"@id":"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/07\/send-real-time-notification-with-pusher-using-laravel-and-javascript-1-1-1-1.png","datePublished":"2021-01-16T09:33:07+00:00","dateModified":"2024-08-12T07:17:37+00:00","breadcrumb":{"@id":"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/#primaryimage","url":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/07\/send-real-time-notification-with-pusher-using-laravel-and-javascript-1-1-1-1.png","contentUrl":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/07\/send-real-time-notification-with-pusher-using-laravel-and-javascript-1-1-1-1.png","width":772,"height":484,"caption":"Send real time notification with Pusher using Laravel and Javascript"},{"@type":"BreadcrumbList","@id":"https:\/\/infyom.com\/blog\/send-real-time-notification-with-pusher-using-laravel-and-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/infyom.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Send real time notification with Pusher using Laravel and Javascript"}]},{"@type":"WebSite","@id":"https:\/\/infyom.com\/blog\/#website","url":"https:\/\/infyom.com\/blog\/","name":"Blog | InfyOm Technologies","description":"","publisher":{"@id":"https:\/\/infyom.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/infyom.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/infyom.com\/blog\/#organization","name":"InfyOm Technologies","url":"https:\/\/infyom.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/infyom.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/06\/InfyOm-Logo.png","contentUrl":"https:\/\/infyom.com\/blog\/wp-content\/uploads\/2024\/06\/InfyOm-Logo.png","width":88,"height":41,"caption":"InfyOm Technologies"},"image":{"@id":"https:\/\/infyom.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/infyom","https:\/\/x.com\/InfyOm","https:\/\/www.instagram.com\/infyomtechnologies\/","https:\/\/in.linkedin.com\/company\/infyom-technologies","https:\/\/github.com\/infyomlabs","https:\/\/x.com\/infyom"]},{"@type":"Person","@id":"https:\/\/infyom.com\/blog\/#\/schema\/person\/659bfc844c333d041221e83c5f5ec754","name":"InfyOm","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/infyom.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1ad162864d8d33c04ea9e6d0333cc483?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ad162864d8d33c04ea9e6d0333cc483?s=96&d=mm&r=g","caption":"InfyOm"}}]}},"_links":{"self":[{"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/posts\/4172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/comments?post=4172"}],"version-history":[{"count":22,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/posts\/4172\/revisions"}],"predecessor-version":[{"id":5841,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/posts\/4172\/revisions\/5841"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/media\/4174"}],"wp:attachment":[{"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/media?parent=4172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/categories?post=4172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infyom.com\/blog\/wp-json\/wp\/v2\/tags?post=4172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}