Skip to content
Back to skills

Creating Value Object

ASecurity

Create or change immutable business values with meaningful invariants, equality, or behavior, such as order numbers and money. Use when primitive values obscure domain rules; avoid wrapping every scalar.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 29, 2026
ai-agentsexpressdatabase

Security analysis

A100/100

Scanned September 29, 2026

npx -y skills add maiobarbero/laravel-boost-ddd --skill creating-value-object --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Creating Value Object?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Creating Value Object
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/maiobarbero-creating-value-object/badge)](https://www.skillsdirectory.com/skills/maiobarbero-creating-value-object)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: creating-value-object
description: Create or change immutable business values with meaningful invariants, equality, or behavior, such as order numbers and money. Use when primitive values obscure domain rules; avoid wrapping every scalar.
---

# Value Objects

Use `App\Domain\<Capability>\ValueObjects` and the domain name, such as `OrderNumber` or `Money`, without a `ValueObject` suffix.

Value Objects are immutable by default and normally final. Validate invariants at construction, preserve them through operations, and compare by value when equality matters. Use specific domain exceptions for invalid values. Do not add HTTP validation or presentation dependencies.

For the order example, an `OrderNumber` is useful if it enforces a business format or supports meaningful operations. A numeric database ID alone does not justify a wrapper. A cancellation fee may justify Money with explicit currency and precision semantics; do not invent currency conversion rules or use floating-point arithmetic for exact money.

Reuse existing compatible value types and Eloquent casts. When persisting a Value Object, define and test its storage round trip only if the use case needs it. Avoid introducing a new package, generic Value Object base class, or custom casting framework automatically.

Application Data objects carry use-case input; Value Objects express business meaning. Choose based on responsibility rather than the number of properties.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.