Add Container field

This commit is contained in:
Utkarsh Khedkar
2026-02-17 14:32:48 +05:30
parent 0a65d5f596
commit 94e211f87e
49 changed files with 8989 additions and 1290 deletions

View File

@@ -1 +1,6 @@
import './bootstrap';
import "./bootstrap";
// VERY IMPORTANT — Load Echo globally
import "./echo";
console.log("[APP] app.js loaded");

31
resources/js/echo.js Normal file
View File

@@ -0,0 +1,31 @@
import Echo from 'laravel-echo';
import Pusher from 'pusher-js';
window.Pusher = Pusher;
// Get CSRF token from meta tag
const csrfToken = document.querySelector('meta[name="csrf-token"]')?.getAttribute('content');
window.Echo = new Echo({
broadcaster: 'reverb',
key: import.meta.env.VITE_REVERB_APP_KEY,
wsHost: import.meta.env.VITE_REVERB_HOST,
wsPort: import.meta.env.VITE_REVERB_PORT ?? 8080,
wssPort: import.meta.env.VITE_REVERB_PORT ?? 8080,
forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'http') === 'https',
enabledTransports: ['ws', 'wss'],
authEndpoint: '/admin/broadcasting/auth',
// ⭐ MOST IMPORTANT ⭐
withCredentials: true,
auth: {
headers: {
'X-CSRF-TOKEN': csrfToken,
'Accept': 'application/json',
}
}
});
console.log('%c[ECHO] Initialized!', 'color: green; font-weight: bold;', window.Echo);