Getting Started
Installation
Real-time notification and broadcasting
Strata's admin interface uses Laravel Echo to broadcast notifications in real-time.
This feature assumes you have installed Laravel Echo and the window.Echo
object is globally available in a file called echo.js
located in the public/strata
directory (/public/strata/echo.js
). For more info on how to set up Echo, check out the Laravel docs on client side installation.
Strata will include this file in the admin interface and use it to provide real-time notifications.
Here's an example using Pusher as the provider and Vite as the build system. This would be put in a file called echo.js
and compiled to public/strata/echo.js
.
1import Echo from 'laravel-echo'; 2import Pusher from 'pusher-js'; 3 4window.Pusher = Pusher; 5 6window.Echo = new Echo({ 7 broadcaster: 'pusher', 8 key: import.meta.env.VITE_PUSHER_APP_KEY, 9 cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER,10 forceTLS: true11});