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
This commit is contained in:
@@ -17,6 +17,13 @@ class Vote extends Model
|
||||
'deadline' => 'datetime',
|
||||
];
|
||||
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::creating(function (Vote $vote) {
|
||||
$vote->created_by ??= auth()->id();
|
||||
});
|
||||
}
|
||||
|
||||
public function creator(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
|
||||
Reference in New Issue
Block a user