renoki-co/laravel-useful-casts
renoki-co/laravel-useful-casts provides a collection of handy custom Eloquent casts for Laravel models, reducing boilerplate when converting database attributes into common PHP types and objects. Drop-in casts keep model code cleaner and more expressive.
renoki-co/laravel-useful-casts is a small, single-purpose utility that supplies additional Eloquent attribute casts. The decision it informs is narrow but recurring: do we pull in a lightweight dependency for common custom casts, or maintain our own cast classes in app/Casts? At this size, the honest answer is usually "write the two or three casts we actually need" — adoption only pays off if the team is routinely re-implementing the same casts across services.Adopt when:
Look elsewhere (or stay on 2.1.x) when:
^2.2 only after the platform upgrade, and consider exact pins or a lockfile policy) rather than trusting caret ranges to be safe.To executives: This is a small, low-risk utility library that removes repetitive boilerplate from our Laravel data models. Release 2.2.0 aligns it with Laravel 10 and PHP 8.2, which matches where we are heading. There is no commercial commitment, no data-handling implication, and no critical-path dependency — the only real decision is whether the convenience is worth one more package to track. My recommendation is to treat it as optional and adopt only if engineering confirms repeated cast duplication.
To engineering: Version 2.2.0 adds Laravel 10.x and PHP 8.2 support and drops Laravel 8.x and PHP 8.0. Treat the upgrade as breaking despite the minor version number: it will fail to install on PHP 8.0 or Laravel 8, so sequence it after the platform upgrade, not before. Pin the constraint explicitly, run the full suite against 8.2, and confirm no model relies on cast behaviour that changed. If we are not already using this package, there is no urgency to add it — evaluate against writing casts in-house first.
How can I help you explore Laravel packages today?