Files
persegi/app/Observers/VoteObserver.php
T
tuxarmy e2f7d7f10f fix: implementasi FilamentUser interface agar panel bisa diakses di production
- Tambah FilamentUser interface di User model
- Tambah canAccessPanel() method
- Tambah VoteObserver: broadcast notifikasi ke semua user saat vote baru
- Tambah NotificationService::toAll()
- Fix Vote model: auto-fill created_by via booted()
- Fix CashRecordObserver: fallback created_by untuk Vote
2026-04-03 11:31:12 +07:00

20 lines
416 B
PHP

<?php
namespace App\Observers;
use App\Models\Vote;
use App\Services\NotificationService;
class VoteObserver
{
public function created(Vote $vote): void
{
NotificationService::toAll(
'Voting Baru Dibuat',
"Voting \"{$vote->title}\" telah dibuka. Silakan berikan suara Anda.",
'info',
route('filament.admin.resources.votes.index')
);
}
}