title: Laravel is not defined while applying real time chat
body: <p>This is my code,</p>
  
  <pre><code>window.Laravel = {!! json_encode([
  
              'csrfToken' =&gt; csrf_token(),
              'user' =&gt; [
              'authenticated' =&gt; auth()-&gt;check(),
              'id' =&gt; auth()-&gt;check() ? auth()-&gt;user()-&gt;id : null,
              'name' =&gt; auth()-&gt;check() ? auth()-&gt;user()-&gt;name : null
              ],
  
              'keys' =&gt; [
                  'pusher' =&gt; config('broadcasting.connections.pusher.key')
              ]
  
           ])!!};
  </code></pre>
  
  <p>here is code in bootstrap.js</p>
  
  <pre><code> import Echo from "laravel-echo"
  
  window.Pusher = require('pusher-js');
  
    window.Echo = new Echo({
       broadcaster: 'pusher',
       key: Laravel.keys.pusher
    });
  </code></pre>
  
  <p>and I get this error</p>
  
  <pre><code>app.js:28113 Uncaught ReferenceError: Laravel is not defined
      at Object.VERSION (app.js:28113)
      at __webpack_require__ (app.js:20)
      at Object.defineProperty.value (app.js:28043)
      at __webpack_require__ (app.js:20)
      at Object.&lt;anonymous&gt; (app.js:28028)
      at __webpack_require__ (app.js:20)
      at app.js:63
      at app.js:66
  </code></pre>
  
  <p>Says </p>
  
  <pre><code>window.Echo = new __WEBPACK_IMPORTED_MODULE_0_laravel_echo___default.a({
    broadcaster: 'pusher',
    key: Laravel.keys.pusher(here says Uncaught ReferenceError: Laravel is not defined)
  });
  </code></pre>
  
  <p>I tried solutions as its in this <a href="https://stackoverflow.com/questions/39137883/laravel-is-not-defined">Laravel is not defined</a> , but It didnt work.. Any ideas?</p>