Fix guest runtime config serialization

This commit is contained in:
Codex Agent
2025-11-12 21:06:28 +01:00
parent 574aa47ce7
commit a4feb431fb

View File

@@ -7,13 +7,16 @@
<meta name="csrf-token" content="{{ csrf_token() }}">
@viteReactRefresh
@vite(['resources/css/app.css', 'resources/js/guest/main.tsx'])
@php
$guestRuntimeConfig = [
'push' => [
'enabled' => config('push.enabled', false),
'vapidPublicKey' => config('push.vapid.public_key'),
],
];
@endphp
<script>
window.__GUEST_RUNTIME_CONFIG__ = @json([
'push' => [
'enabled' => config('push.enabled', false),
'vapidPublicKey' => config('push.vapid.public_key'),
],
]);
window.__GUEST_RUNTIME_CONFIG__ = {!! json_encode($guestRuntimeConfig) !!};
</script>
</head>
<body>