fix: Filament v5 callbacks $r → $record (Plans/Subs/SuperAdmins/Companies)
+ central PWA: real PNG icons, SW registration, scope=/
- All `fn ($r) =>` and `fn (Type $r) =>` replaced with $record (Filament v5
injects callback params by name; $r resolved to nothing)
- /pwa/admin-{192,512}.png — generated on-the-fly with GD + DejaVuSans-Bold
- /pwa/admin-icon.svg — vector favicon
- /admin-sw.js — service worker (cache shell, network-first elsewhere)
with Service-Worker-Allowed: / header
- Manifest scope=/ + start_url=/admin → install prompt fires on Chrome/Edge/Safari
- BODY_END render hook registers SW on central panel
This commit is contained in:
@@ -67,9 +67,22 @@ class CentralPanelProvider extends PanelProvider
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="default">
|
||||
<meta name="apple-mobile-web-app-title" content="AutoCRM Admin">
|
||||
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><rect width='100' height='100' rx='20' fill='%236366f1'/><text x='50' y='66' font-size='52' text-anchor='middle' fill='%23fff' font-family='sans-serif' font-weight='bold'>A</text></svg>">
|
||||
<link rel="icon" type="image/svg+xml" href="/pwa/admin-icon.svg">
|
||||
<link rel="apple-touch-icon" href="/pwa/admin-512.png">
|
||||
BLADE)
|
||||
)
|
||||
->renderHook(
|
||||
PanelsRenderHook::BODY_END,
|
||||
fn (): string => <<<'HTML'
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('/admin-sw.js', { scope: '/' }).catch(() => {});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
HTML
|
||||
)
|
||||
->middleware([
|
||||
EncryptCookies::class,
|
||||
AddQueuedCookiesToResponse::class,
|
||||
|
||||
Reference in New Issue
Block a user