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:
@@ -29,10 +29,10 @@ class PendingPayments extends BaseWidget
|
||||
Tables\Columns\TextColumn::make('invoice_number')
|
||||
->label('Factură')
|
||||
->copyable()
|
||||
->url(fn ($r) => SubscriptionResource::getUrl('edit', ['record' => $r])),
|
||||
->url(fn ($record) => SubscriptionResource::getUrl('edit', ['record' => $record])),
|
||||
Tables\Columns\TextColumn::make('company.name')->label('Companie'),
|
||||
Tables\Columns\TextColumn::make('plan.name')->placeholder('—'),
|
||||
Tables\Columns\TextColumn::make('amount')->money(fn ($r) => $r->currency)->weight('bold'),
|
||||
Tables\Columns\TextColumn::make('amount')->money(fn ($record) => $record->currency)->weight('bold'),
|
||||
Tables\Columns\TextColumn::make('status')
|
||||
->badge()
|
||||
->color(fn ($s) => $s === 'overdue' ? 'danger' : 'warning')
|
||||
@@ -40,7 +40,7 @@ class PendingPayments extends BaseWidget
|
||||
Tables\Columns\TextColumn::make('due_at')
|
||||
->label('Scadent')
|
||||
->dateTime()
|
||||
->color(fn ($r) => $r->due_at && $r->due_at->isPast() ? 'danger' : null),
|
||||
->color(fn ($record) => $record->due_at && $record->due_at->isPast() ? 'danger' : null),
|
||||
])
|
||||
->emptyStateHeading('🎉 Toate facturile sunt plătite')
|
||||
->paginated(false);
|
||||
|
||||
Reference in New Issue
Block a user