89 lines
3.0 KiB
PHP
89 lines
3.0 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="<?php echo e(str_replace('_', '-', app()->getLocale())); ?>">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
|
|
<meta name="midtrans-client-key" content="<?php echo e(config('services.midtrans.client_key')); ?>">
|
|
<meta name="midtrans-snap-url" content="<?php echo e(config('services.midtrans.snap_url')); ?>">
|
|
|
|
<title><?php echo e(config('app.name', 'DFOOD')); ?></title>
|
|
|
|
|
|
<?php echo app('Illuminate\Foundation\Vite')(['resources/css/app.css', 'resources/js/app.js']); ?>
|
|
|
|
<style>
|
|
.opacity-bg {
|
|
background-color: rgba(0, 0, 0, 0.75);
|
|
}
|
|
|
|
input[type="radio"],
|
|
input[type="checkbox"],
|
|
input[type="button"],
|
|
input[type="submit"],
|
|
input[type="reset"],
|
|
input[type="image"],
|
|
select,
|
|
button {
|
|
cursor: pointer;
|
|
}
|
|
</style>
|
|
<?php echo \Livewire\Mechanisms\FrontendAssets\FrontendAssets::styles(); ?>
|
|
|
|
</head>
|
|
|
|
<body class="font-sans antialiased">
|
|
|
|
<?php echo e($slot); ?>
|
|
|
|
|
|
<script src="https://app.sandbox.midtrans.com/snap/snap.js" data-client-key="<?php echo e(config('services.midtrans.client_key')); ?>"></script>
|
|
|
|
|
|
<script>
|
|
document.addEventListener('livewire:initialized', function() {
|
|
// Event Notifikasi (global notification)
|
|
Livewire.on('notify', (data) => {
|
|
console.log('🔔 Notification:', data.message);
|
|
window.dispatchEvent(new CustomEvent('notify', {
|
|
detail: {
|
|
message: data.message
|
|
}
|
|
}));
|
|
});
|
|
|
|
// Debug Log
|
|
Livewire.on('logToConsole', (data) => {
|
|
console.log('[Livewire Log]', data.message);
|
|
});
|
|
|
|
// Refresh CSRF Token tiap 30 menit
|
|
setInterval(() => {
|
|
fetch('/refresh-csrf', {
|
|
headers: {
|
|
'X-Requested-With': 'XMLHttpRequest'
|
|
}
|
|
})
|
|
.then(response => response.json())
|
|
.then(data => {
|
|
const csrfMeta = document.querySelector('meta[name="csrf-token"]');
|
|
if (csrfMeta) {
|
|
csrfMeta.setAttribute('content', data.csrf_token);
|
|
console.log('🔁 CSRF token refreshed:', data.csrf_token);
|
|
}
|
|
})
|
|
.catch(error => {
|
|
console.error('❌ Gagal refresh CSRF token:', error);
|
|
});
|
|
}, 1800000); // 30 menit
|
|
});
|
|
</script>
|
|
|
|
|
|
<?php echo \Livewire\Mechanisms\FrontendAssets\FrontendAssets::scripts(); ?>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
<?php /**PATH E:\!PROJECT\dfood-website\resources\views/components/layouts/front.blade.php ENDPATH**/ ?>
|