fasano/phprimitives
fasano/phprimitives provides strongly-typed, immutable wrappers for PHP primitives, turning strings, numbers, booleans, and arrays into self-validating value objects with a clean, chainable API for safer data handling in PHP and Laravel apps.
composer require n-fasano/phprimitives.src/ and tests/ for the exact primitive classes, construction methods, and exception behavior. The release note specifically touches InvalidBackingValue, so check that exception and where it is thrown first.InvalidBackingValue at the boundary when constructing from untrusted input, and translate it into a Laravel ValidationException if the failure should appear as a form validation error.InvalidBackingValue message.InvalidBackingValue’s message. Treat this as a patch-level message cleanup, but update any tests, log assertions, or snapshots that matched the old text.InvalidBackingValue by type, not by message. Message text is not a stable contract.null is a valid primitive state or whether absence should bypass primitive construction entirely.composer.json before adopting the package in an existing app.How can I help you explore Laravel packages today?