$business->id, 'user_id' => $user?->id, 'action' => $action, 'entity_type' => $entityType, 'entity_id' => $entityId, 'description' => $description, 'properties' => $properties, ]); } public static function logEquipmentHistory( Business $business, int $equipmentId, string $entryType, string $title, ?string $description = null, ?User $user = null, int $cost = 0, ?string $relatedType = null, ?int $relatedId = null, ?array $metadata = null ): HistoryEntry { return HistoryEntry::create([ 'business_id' => $business->id, 'equipment_id' => $equipmentId, 'entry_type' => $entryType, 'title' => $title, 'description' => $description, 'cost' => $cost, 'performed_by' => $user?->id, 'performed_at' => now(), 'related_type' => $relatedType, 'related_id' => $relatedId, 'metadata' => $metadata, ]); } }