belongsTo(Order::class, 'order_id', 'id'); } public function media() { return $this->belongsTo(Media::class, 'media_id', 'id'); } public function getActivitylogOptions(): LogOptions { return LogOptions::defaults() ->logOnly([ 'payment_request_letter', 'invoice', 'bank_reference', 'electronic_tax_invoice', 'other_document', 'description', 'status', 'rejection_reason', 'media_id', 'order_id', ]) ->useLogName('cooperation_completion') // 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 "Penyelesaian kerja sama telah {$eventName}"; } }