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

Expires Laravel Package

createnl/expires

A Laravel package for adding expiration to Eloquent models. Attach expiry dates to records, automatically scope out or clean up expired entries, and keep outdated data under control with simple, configurable traits and queries.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit The package remains a conventional Laravel/PHP library — no evidence of service-provider-level changes, framework version constraint shifts, or new infrastructure dependencies in 0.3. It continues to fit the standard Composer-installed package model our application already assumes. The release is primarily an API-surface and correctness change rather than an architectural one, so it does not require revisiting how the package sits in our layering (controllers → services → package).

Integration feasibility Straightforward mechanically, but not a drop-in. The headline change — return types moving from bool to Model — is a breaking API change for every existing call site. Eloquent models are truthy, so naive if ($result) checks keep working, but strict comparisons (=== true, !== false), is_bool() guards, and any method signature that declares : bool or accepts a bool will fail — the latter with a TypeError at runtime, not at install time. Feasibility therefore depends on how densely we consume the affected methods; this is a same-day change if call sites are few and tested, and a multi-day change if the package is used broadly across services.

Technical risk

  • Breaking change on a pre-1.0 version. 0.3 → semver permits breaks, but that also means we cannot rely on semver to protect us going forward. We must pin exact or caret-constrained versions and treat every minor bump as potentially breaking until 1.0.
  • Silent behavioural divergence is low, but silent contract divergence is real. The new return value carries more information (the persisted model), which callers may start depending on before we have validated the model's state guarantees.
  • The addOnlyExpired fix changes outcomes for existing data. Bug fixes in expiry logic mean records previously skipped may now be processed, or vice versa. Any production dataset that has accumulated under the buggy behaviour will behave differently on first run after upgrade.
  • "Added methods" is unspecified. Unquantified new surface is unquantified support burden and potential future breakage.
  • Low blast radius overall. This is a small, focused package with a narrow footprint; the risk is concentrated in consumer code, not in the dependency itself.

Key questions

  1. Which methods changed their return type, exactly, and what model class is returned — a package-owned model or one of ours?
  2. Does the returned model reflect the persisted row (post-save state, ID populated) or the in-memory instance pre-persistence?
  3. What methods were added, and do any of them overlap with or deprecate existing ones?
  4. What precisely was the addOnlyExpired bug, and does the fix alter behaviour for already-stored records?
  5. Is a 0.4 or 1.0 planned, and is there an intent to stabilise the public API?
  6. Is there a published upgrade note beyond the README update, and does the README document the new return contracts?

Integration Approach

Stack fit No framework-version or PHP-version signal in the release notes, so compatibility with our current Laravel and PHP baselines is unconfirmed and must be verified against composer.json constraints before scheduling. Nothing suggests a mismatch, but nothing confirms parity either.

Migration path Adopt incrementally, not wholesale. Sequence: (1) pin the new version in a single non-production environment; (2) enumerate every call site of the changed methods via static search; (3) classify each as truthiness-safe, strict-comparison-unsafe, or signature-unsafe; (4) convert strict comparisons to explicit null/instance checks rather than relying on model truthiness, which will be clearer and more durable; (5) land the upgrade behind tests that assert on the returned model, not just on success/failure.

Compatibility Two independent compatibility surfaces. First, runtime compatibility — the return type change is source-compatible for loose checks and source-incompatible for strict ones, and binary-incompatible for any typed signatures. Second, data compatibility — the addOnlyExpired fix implies behavioural drift against existing rows. Treat the data surface as the riskier of the two, because it fails quietly rather than loudly.

Sequencing Do not bundle this with unrelated dependency work. Land the pinned upgrade and the call-site fixes as one atomic change with its own rollback point, verify addOnlyExpired behaviour against a representative staging dataset before touching production, and only then allow further consumption of the new methods. Defer adoption of the added methods to a follow-up so that the breaking change and the new feature are separately attributable if something regresses.

Operational Impact

Maintenance The return-type change is a one-time migration cost, but it also resets our assumptions about API stability. Budget for reviewing each subsequent release rather than accepting minor bumps automatically. The unspecified new methods add surface we now own the upgrade risk on.

Support Expect a short tail of incidents from call sites that were not caught by static search — dynamic dispatch, package-adjacent code, or boolean logic buried in conditionals. The README was updated, which helps onboarding, but no dedicated upgrade guide is evidenced; internal documentation of the new return contract should be written by us, not assumed from upstream.

Scaling No scaling implications from this release. Return values do not change query volume, memory profile, or concurrency behaviour. The only scaling-adjacent concern is volume-dependent: the addOnlyExpired fix will process a backlog in whatever volume accumulated during the bug's lifetime, so a first production run after upgrade may be materially heavier than steady state. Throttle or dry-run that first execution.

Failure modes

  • TypeError at runtime from typed signatures or callers passing the result into boolean-typed parameters — loud, immediate, caught in staging if coverage is decent.
  • Inverted or dead branches from === true / === false comparisons that now never match — silent, the highest-risk failure mode here.
  • Unexpected record processing from the addOnlyExpired fix against historical data — silent, potentially destructive.
  • Unanticipated coupling to newly returned model attributes — silent, and only surfaces when a later release changes the model.

Ramp-up Low for engineers already familiar with the package; the mental model shift is small but must be explicit — "these methods return the affected record, not a success flag." Allocate a short internal briefing or ADR note covering the new contract, the pinned version policy, and the staging-first verification of addOnlyExpired. New contributors are the main exposure: a README-level change is easy to miss, and loose truthiness checks will let incorrect assumptions compile and pass review.

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.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels