Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Value Object

Value Object Laravel Package

micro-module/value-object

Immutable, self-validating value objects for PHP and Laravel. Wrap primitives like emails, IDs, and money in typed classes that guard their own invariants, so invalid values can't exist and domain logic stays clean, testable, and free of scattered validation checks.

View on GitHub
Deep Wiki
Context7

micro-module/value-object is a lightweight PHP package for building immutable, self-validating value objects in Laravel applications. It helps you replace primitive strings and integers with expressive domain types, keeping validation and business rules close to your data.

  • Define immutable value objects with typed properties
  • Self-validation on construction to prevent invalid state
  • Built-in equality comparison between instances
  • Framework-agnostic, with optional Laravel integration
  • Minimal, zero-dependency design for fast bootstrapping
Frequently asked questions about Value Object
What is micro-module/value-object used for in Laravel?
It is a lightweight package for creating immutable value objects with built-in validation and type safety in Laravel or plain PHP applications. It helps encapsulate domain concepts such as email addresses or money objects and reduces primitive obsession across your codebase. The package is intentionally small, so expect a thin base class or trait set rather than a full DDD framework.
How do I install micro-module/value-object with Composer?
Install it with composer require micro-module/value-object after checking the package's composer.json constraints against your PHP and Laravel versions. Integration is mechanical: you extend a base class or use a trait depending on what ships. Because adoption is low, read the source and run its tests before adding it to production.
Which PHP and Laravel versions does micro-module/value-object support?
The package does not publicly document verified PHP or Laravel version support in the provided context, and PHP 8.2, 8.3, and 8.4 compatibility is unverified. Check composer.json and any CI configuration for declared constraints before installing. Treat narrow illuminate/support ranges as a coupling risk if you need the package in a framework-agnostic domain layer.
How does micro-module/value-object enforce immutability?
Immutability enforcement is not confirmed in the overview, so audit the source to see whether it uses readonly properties, magic __set guards, or convention only. Pay attention to array and object members, since those can still be mutated by reference even when the value object itself looks immutable. Write conformance tests for mutation and equality behavior before relying on it.
Does micro-module/value-object support Eloquent casts and JSON serialization?
Eloquent casting and JSON serialization support are not stated in the package description, so verify whether it implements JsonSerializable, __serialize, or Laravel cast contracts. If casts are missing, you will need custom hydration and dehydration logic in your models and API resources. Round-trip tests through Eloquent and queued jobs are essential because immutable objects often fail silently there.
Is micro-module/value-object framework-agnostic or tied to Laravel?
It is unclear from the overview whether the package requires illuminate/support or can run in a pure domain layer. Framework-agnostic behavior is materially better for hexagonal or layered architectures, so inspect composer.json for Laravel dependencies. If it pulls in Laravel components at a narrow version range, isolate it behind your own abstraction.
How does micro-module/value-object compare to spatie/laravel-data or brick/money?
This package is much smaller and narrower than spatie/laravel-data or brick/money, and it has very low adoption with zero dependents. Those alternatives offer mature feature sets, documentation, and production usage, while micro-module/value-object may be closer to a thin in-house base class. Compare the actual source size and features before choosing it over a 150-line internal implementation.
Can I use micro-module/value-object with readonly properties in PHP 8.2+?
PHP 8.2 readonly classes and properties are a natural fit for immutable value objects, but the package's compatibility is unverified. Check whether it uses readonly internally or relies on older immutability patterns. If you are on PHP 8.2 or newer, a small first-party readonly class may be simpler than adding a low-adoption dependency.
What tests and static analysis does micro-module/value-object include?
The provided assessment asks you to check for a test suite, CI, PHPStan or Psalm configuration, and a license file, but does not confirm they exist. Before adoption, run the tests locally and review static-analysis coverage. Missing tests or CI is a correctness risk even though the package has a small security surface.
Is micro-module/value-object production-ready and actively maintained?
Signals point to high technical risk: one star, zero dependents, a single recent release in April 2025, and an effective bus factor of one. Recent activity does not prove release cadence or semver discipline, and there is no downstream bug-report trail. Pilot it in one bounded context behind an in-house abstraction, or budget to replace it with first-party code.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route