lundi 14 octobre 2019

Where to include app.js file for laravel echo?

I am trying to get real time notification through pusher. i can see notification in debug console of pusher but when i try to get with help of laravel echo it doesn't work. I observe that when i include app.js file in header debug console show connection and disconnection . but without it is just notification on debug console.

header

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">

<meta name="user-id" content="">
<meta name="csrf-token" content="">

    <link rel="stylesheet" href="">
    <link rel="stylesheet" href="">
    <link rel="stylesheet" href="">
    <link rel="stylesheet" href="">
    <link rel="stylesheet" href="">
    <!-- favicon -->
    <link rel="icon" href="">
    <title>Boli.Pk | @yield('title')</title>

    <script>window.laravel = {!! json_encode(['csrfToken' => csrf_token(),]) !!};</script>
    <script src="" defer></script>
</head>

//laravel echo code

window.Echo.private('App.User.'+userId)
.notification((notification) => {
    alert("yes");
    console.log(notification.type);
});

I think i am making mistake while including app.js



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2OLO6uF
via IFTTT

Aucun commentaire:

Enregistrer un commentaire