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 Objects Bundle

Value Objects Bundle Laravel Package

plusforta/value-objects-bundle

A Laravel bundle of reusable value objects for common domain concepts, helping you keep validation, casting, and type safety consistent across your application instead of scattering raw strings and primitives throughout your models and services.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Value Objects Bundle
What is plusforta/value-objects-bundle used for?
It provides ready-to-use base classes for common domain value objects such as strings, numbers, booleans, collections, and equality helpers, so you can replace loose scalars with immutable, self-validating types across your models and services. It ships with a Symfony/Doctrine heritage and a cast and serialization layer intended to keep validation and persistence consistent. Typical use cases include modelling email addresses, identifiers, IBANs, money amounts, and normalised strings instead of passing raw values around. It is a leaf-type library with no I/O or runtime services, so the integration footprint is small.
How do I install plusforta/value-objects-bundle in a Laravel application?
Install it with Composer using composer require plusforta/value-objects-bundle, then register the service provider if Laravel package discovery does not pick it up automatically, and publish the configuration file if the bundle exposes one. Before committing, run composer why-not plusforta/value-objects-bundle in a scratch project that mirrors your composer.json so you can see how it resolves against illuminate/support, illuminate/database, and your PHP constraint. The integration surface is narrow, so a spike should take hours rather than sprints.
Which Laravel and PHP versions does this value objects package support?
The package does not publish a clear Laravel support matrix, so check the php and illuminate/support constraints in its composer.json before adopting it. It is assumed to target PHP 8.1+ and Laravel 9, 10, or 11, but that should be confirmed against your own dependency graph. If it pins a single minor Laravel release, treat adoption as point-in-time and plan to own patches yourself.
How do I configure plusforta/value-objects-bundle?
Configuration follows Symfony-style conventions, so expect a publishable config file plus service definitions rather than heavy Laravel-specific setup. Publish the config with vendor:publish and keep your own overrides in a separate config file so upgrades do not silently change validation policy. Because validation rules such as email regex versus filter_var, phone normalisation, and IBAN or VAT conventions are baked into the package, treat any config you touch as a domain decision, not just a setting.
Does it work with Eloquent casts and attribute casting?
The bundle is designed to store value objects transparently through a cast and serialization layer, which maps onto Eloquent casts for attribute access. Be aware that the package effectively owns the persistence and serialization format, so leaving it later means a data migration rather than a simple Composer removal. Test round-trip serialization on your real column types before rolling it out beyond a pilot.
Are the value objects actually immutable?
Immutability is the stated design goal, but PHP value objects frequently leak mutable internals through arrays or DateTime instances. Verify in the source whether readonly properties and private constructors are enforced or merely conventional, and check that getters return copies rather than internal references. Writing a few of your own unit tests against mutation attempts is a quick way to confirm the guarantee holds.
Should I use this package for money and financial calculations?
Do not let this bundle be the only thing standing between you and a rounding bug. Money value objects embed policy decisions about rounding, currency handling, and formatting, and dedicated libraries such as moneyphp/money or brick/money carry years of edge-case coverage. Use the bundle for structural consistency if you like, but validate it against those libraries or your finance team before handling real amounts.
How do I test value objects from this package?
Value objects are plain PHP with no I/O, so they are cheap to unit test. Write tests that assert an exception is thrown for invalid input, that equality and comparison helpers behave as expected, and that serialization survives a round trip through your database column. Wrap package exceptions in your own domain exceptions if you do not want your error handling coupled to the bundle's public contract.
Is plusforta/value-objects-bundle safe to use in production?
Mechanically yes, since it introduces no runtime, extension, or daemon, but the assurance level is low. The project has zero stars, zero dependents, is hosted on GitLab with no public issue history or visible changelog discipline, and appears to be an internal Plusforta package published for CI convenience. Treat it as code to vendor rather than a supported dependency to consume, adopt it in one bounded context first, and keep the bus factor of one or two authors in mind. Also read the licence to confirm it permits proprietary use and internal redistribution.
What are the alternatives to plusforta/value-objects-bundle?
You can hand-roll value objects with PHP 8 readonly classes and enums, which gives you full control over validation policy. For specific primitives, moneyphp/money or brick/money cover money, ramsey/uuid covers identifiers, and webmozart/assert helps with guards. Laravel's built-in casts and validation rules handle simpler cases without adding a third-party dependency at all. Choose the bundle only if its type catalogue matches your domain vocabulary closely enough to justify the lock-in.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource