toJson(); return new System( version: 1, createdBy: $userId, updatedBy: $userId, createdAt: $now, updatedAt: $now, ); } public function update(string $userId): System { $now = Carbon::now()->toJson(); return new System( version: $this->version + 1, createdBy: $this->createdBy, updatedBy: $userId, createdAt: $this->createdAt, updatedAt: $now, ); } }