'array']; } public static function record(string $actorType, ?string $actor, string $action, ?Model $subject = null, array $changes = [], ?int $tenantId = null): self { return static::create([ 'tenant_id' => $tenantId ?? ($subject?->tenant_id ?? null), 'actor_type' => $actorType, 'actor' => $actor, 'action' => $action, 'subject_type' => $subject ? $subject::class : null, 'subject_id' => $subject?->getKey(), 'changes' => $changes ?: null, 'ip' => request()?->ip(), ]); } }