belongsTo(User::class, 'enhancer_id', 'id'); } public function users() { return $this->belongsToMany(User::class, 'announcements_users', 'announcement_id', 'user_id') ->using(AnnouncementUser::class) ->withPivot(['status', 'category']) ->withTimestamps(); } public function getActivitylogOptions(): LogOptions { return LogOptions::defaults() ->logOnly(['headline', 'content', 'link', 'attachment', 'enhancer_id']) // kolom yang dicatat ->useLogName('announcement') // nama log ->logOnlyDirty(); // hanya log kalau ada perubahan } public function getDescriptionForEvent(string $eventName): string { switch ($eventName) { case 'created': $eventName = 'dibuat'; break; case 'updated': $eventName = 'diubah'; break; case 'deleted': $eventName = 'dihapus'; break; } return "Pengumuman pengguna '{$this->headline}' telah {$eventName}"; } }