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

Laravel Useful Casts Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for Eloquent model boilerplate. 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.
  • Platform upgrade sequencing. The 2.2.0 release is the substantive signal here: it adds Laravel 10.x and PHP 8.2 support while dropping Laravel 8.x and PHP 8.0. That makes the package a trailing indicator of our own support matrix. If our roadmap still includes Laravel 8 or PHP 8.0 anywhere, this package becomes a blocker on that branch and pins us to 2.1.x.
  • Roadmap fit. On Laravel 9 or 10 with PHP 8.1/8.2, the package is current and safe to evaluate. On Laravel 10 with PHP 8.2, 2.2.0 is the first release that formally supports the combination — worth noting if we had previously been running unsupported.
  • Dependency-surface budgeting. Useful for calibrating how much third-party surface we accept for convenience-only functionality. This package is non-critical-path; it should never gate a release.

When to Consider This Package

Adopt when:

  • You are on Laravel 9.x or 10.x and PHP 8.1 or 8.2 (2.2.0's supported matrix).
  • Your team is repeatedly authoring the same custom casts across multiple models or services, and a shared, tested implementation is cheaper than duplicated code.
  • You are comfortable with a small community dependency maintained by Renoki Co. and are not relying on it for anything on the critical path.

Look elsewhere (or stay on 2.1.x) when:

  • You are still on Laravel 8.x or PHP 8.0 — 2.2.0 will not install, and 2.1.x is now an unsupported branch. Plan the upgrade or fork.
  • You need a formal support/SLA commitment, security backporting guarantees, or a vendor with a published deprecation policy.
  • You only need one or two casts. Writing them in-house removes a dependency for negligible effort.
  • Versioning risk flag for the PM: dropping PHP and Laravel majors inside a minor release (2.1 → 2.2) is a compatibility break published under semver-minor. That is a legitimate concern about the maintainer's release discipline — pin explicitly (^2.2 only after the platform upgrade, and consider exact pins or a lockfile policy) rather than trusting caret ranges to be safe.

How to Pitch It (Stakeholders)

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.

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.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib