tdn/php-types
A small PHP utility for working with types: safely cast values, validate data against expected types, and normalize scalars, arrays and objects. Lightweight and framework-agnostic, it drops easily into Laravel or any Composer project.
readonly properties (8.1), enums (8.1), and constructor promotion did not exist. Use it as a baseline to argue that most of what it wraps is now free in the language, and scope the remaining gap (validation messages, casting into Eloquent, serialization) as the actual build work.NOASSERTION license, the correct product call is to not add this to any dependency manifest.Consider reading it — not installing it — only when:
Look elsewhere — clearly — when:
NOASSERTION means the license is not machine-identifiable; legal review would be required before vendoring, and the effort is not justified for the value delivered.spatie/laravel-data, brick/math for numeric precision, ramsey/uuid, or plain PHP 8.1 enums and readonly classes) cover this with maintained support.To executives: This is a small, abandoned, seven-star PHP library last released in 2015 with no known users and an unclear license. We are not proposing to adopt it. We reviewed it as a free source of prior art while deciding whether to build typed value objects in-house. Recommendation: build our own thin wrapper layer (roughly a sprint of work, owned internally) or use a maintained package — no procurement, no licensing cost, no vendor risk either way. The only cost of the review is engineering reading time.
To engineering: Read it, don't require it. It is a 2015-era answer to primitive obsession that PHP 8.1 has largely solved natively — enums, readonly classes, and promoted constructors remove most of the boilerplate it existed to hide. Where it still adds ideas worth stealing: consistent validation-error surfaces, immutability by construction, and preventing raw scalars from crossing domain boundaries. Where it fails: unmaintained since 2015, unverifiable license, zero dependents, no PHP 8 support guarantees. Concretely, the proposal is an internal app/Domain/ValueObjects layer with Eloquent casts and matching validation rules, covered by unit tests — and a written convention that domain identifiers and money are never plain strings or floats. If anyone wants to cite prior art in the design doc, link this repository as background only; it must not appear in composer.json.
How can I help you explore Laravel packages today?