20 lines
416 B
PHP
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')
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|