Skip to main content

composer.json

Open in GitHub
{
//
"require": {
"php": "^7.2.5",
"ext-gd": "*",
//
"beyondcode/laravel-websockets": "^1.8",
"pusher/pusher-php-server": "~3.0"
},
//
}

resources/assets/js/bootstrap.js

Open in GitHub
import Echo from 'laravel-echo'
window.pusher = require('pusher-js')
//
window.Echo = new Echo({
broadcaster: 'pusher',
key: process.env.MIX_PUSHER_APP_KEY,
host: window.location.hostname,
wsHost: window.location.hostname,
wsPort: 6001,
enabledTransports: ['ws', 'wss'],
disableStats: true,
namespace: 'App.Base.Events',
authEndpoint: 'https://goodwork.local/broadcasting/auth'
})
//

resources/assets/js/components/partials/notificationDropdown.vue

Open in GitHub
<template>
//
</template>
 
<script>
//
export default {
data: () => ({
//
notifications: [],
unreadNotification: false,
//
}),
//
mounted () {
this.listen()
},
//
listen () {
Echo.private('App.User.' + this.user.id)
.notification((notification) => {
this.unreadNotification = true
this.notifications.push(notification)
this.showIndicator()
})
},
showIndicator () {
this.unreadNotification = true
},
//
}
}
</script>

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.