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

Component Then When Laravel Package

serendipity_hq/component-then-when

Serendipity HQ's Component Then When adds fluent then() and when() helpers to Laravel components, letting you chain conditional logic and post-processing directly in component definitions. Lightweight and easy to drop in, it means cleaner, more expressive code with less boilerplate.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The package's domain is narrow and well-bounded: given an attempt count (and optionally a failure history), return the timestamp of the next retry. That is a pure, stateless calculation — the easiest possible thing to embed. However, the description in the request does not match the source material: agents/AGENTS.md states explicitly "This is a Symfony bundle" and describes a Symfony Flex / symfony/* version matrix, a Docker-based PHP matrix, and a rector.php with SymfonySetList. This is not a Laravel package. It will ship a Bundle class, a DI extension, a configuration tree, and service definitions. In Laravel we would consume at most the underlying strategy classes and discard the bundle layer. Architecture fit is therefore conditional: viable as a vendored utility, not viable as an installed framework integration.

Integration feasibility. Feasible but non-trivial. Composer will resolve the package, but Laravel will not auto-register anything, no config is publishable, and no facade or container binding exists. A thin Laravel service provider plus a config file mapping is required, and the strategy objects must be bound manually. The real gate is transitive constraint resolution: the bundle pins multiple Symfony components across a supported matrix, and Laravel already pins its own Symfony component versions. A constraint such as symfony/*: ^8.0 (implied by the "current stable release from minor 0" guidance) will conflict with most current Laravel releases. This must be proven with a throwaway composer require before any design work.

Technical risk. High for a dependency that sits on the retry path of a fault-tolerant system:

  • Adoption risk. 2 stars, 0 dependents. There is no production evidence anywhere in the ecosystem to lean on.
  • Bus factor of one. Single maintainer, no visible security policy, no external contributors referenced.
  • Release hygiene. A last-release date of 2026-03-21 is anomalous. Either a misconfigured release pipeline or manual tagging — both are signals of process immaturity and argue for pinning to an exact version with a committed lockfile.
  • Scope risk is low. The logic is small enough to fully audit and, if necessary, reimplement or fork without meaningful loss. This is the mitigating factor that keeps the risk from being disqualifying.
  • Opportunity score of 34.03 corroborates the qualitative read: low strategic value relative to integration cost.

Key questions to resolve before commitment.

  1. Is the calculation core framework-agnostic (plain PHP + PSR interfaces), or does it depend on Symfony OptionsResolver, Clock, or DependencyInjection at runtime?
  2. What is the exact composer.json constraint set for PHP and each symfony/* package, and does it resolve cleanly inside our target Laravel version's lock?
  3. Does the package persist attempt state, or is it purely a calculator? (Assumed calculator — must be confirmed.)
  4. Which backoff strategies ship out of the box — fixed, linear, exponential, decorrelated jitter — and are they composable?
  5. Is there a documented policy for backward compatibility, and is there a CHANGELOG we can diff?
  6. Who owns the fork if upstream goes dormant?

Integration Approach

Stack fit. Poor as a framework integration, acceptable as an embedded calculator. The bundle's Symfony wiring is dead weight in Laravel; only the strategy/value objects carry value. Treat this as a library vendoring exercise, not a package installation. Budget one engineer for a two-day spike.

Migration path. Three options, in order of preference:

  1. Build in-house (recommended default). Exponential backoff with jitter is roughly 20–40 lines of well-understood code, fully testable, and removes the dependency entirely. Laravel's own queue already exposes backoff, retryUntil, maxExceptions, and Illuminate\Support\Sleep; check whether native primitives cover the requirement before importing anything. If they do, the package adds zero value.
  2. Consume the core classes only. If the spike proves a clean PSR/plain-PHP core, composer require it, add a RetryBackoffServiceProvider, bind each strategy behind an interface we own, and publish a config/retry-backoff.php that maps attempt counts to strategy classes. Wrap every call behind our own interface so the package is swappable and cannot leak into domain code.
  3. Fork and vendor. If the logic is useful but the constraint set or maintenance is hostile, fork under our org, strip the Symfony bundle layer, relicense under the existing MIT terms, and carry it as an internal VCS or path repository.

Compatibility. Before any code, validate: (a) PHP floor — the AGENTS instructions use "php": "^8.2" as the minimum, so confirm our fleet is at or above it; (b) Symfony component constraints against the Laravel version we run; (c) that no transitive dependency drags in a conflicting symfony/dependency-injection or symfony/http-kernel. If resolution requires a --with-all-dependencies churn of Laravel's Symfony pins, stop and take option 1.

Sequencing.

  1. Sandbox spike: resolve dependencies against our Laravel lock, audit the source, confirm the state model. Timebox: two days.
  2. Write a decision record (adopt / adapt / build) with the constraint-resolution output attached.
  3. If adopting: implement the adapter interface and provider, add unit tests reproducing the upstream math independently, add a composer constraint guard in CI.
  4. If building: implement the same interface with our own strategies and jitter, no external dependency.
  5. Either way, wire it into exactly one call site first, behind a feature flag, with the previous behavior as fallback.

Operational Impact

Maintenance. The dominant cost is not code, it is ownership. With one maintainer and no ecosystem, we should assume upstream can go quiet without notice. That means pinning to an exact version, committing the lockfile, tracking the fork as a maintenance item, and scheduling a quarterly review of upstream activity. If we adopt without forking, add a standing ticket to re-evaluate the constraint matrix on every Laravel major upgrade — Symfony component skew is the most likely breakage vector.

Support. No community, no Stack Overflow corpus, no vendor SLA. Support is entirely first-party: engineers read the source. The documentation footprint in the provided material is agent/contributor guidance, not user documentation — do not expect usage examples or migration guides. Factor roughly half a day of engineer ramp-up into the estimate, plus the adapter work.

Scaling. The calculation itself is negligible — it is arithmetic over an integer attempt count, with no I/O, no state, and no concurrency surface. It will not be your bottleneck. The actual scaling considerations live around it and are our responsibilities:

  • State persistence. If the package only calculates and does not record attempts, we own the store (Redis counter, DB column, cache key) and its TTL, eviction, and multi-worker consistency.
  • Clock source. Backoff correctness depends on a single authoritative clock; injecting Carbon per request invites drift and test flakiness.
  • Jitter. Without full jitter or decorrelated jitter, synchronized failures will produce thundering-herd retry spikes at scale. Verify this exists; if it does not, add it in the adapter layer.

Failure modes.

  • Composer resolution failure on a Laravel upgrade — the highest-probability failure, and a build-time one, therefore cheap to detect if CI pins the constraint.
  • Silent upstream abandonment — no new failure, but the component ages out of the supported Symfony matrix and blocks a future upgrade.
  • Anomalous release tagging (the 2026-03-21 date) — a bad tag or force-push could change behavior under a floating constraint; exact-pin mitigates.
  • Unbounded backoff — large attempt counts producing dates far in the future or integer overflow; cap max delay and max attempts explicitly in our config, not upstream's defaults.
  • Timezone/DST edge cases in returned timestamps — standardize on UTC and store instants, not local times.
  • Hidden coupling to Symfony services — if the strategy objects unexpectedly require container-provided services, the wrapper will throw at runtime rather than at build time. Detect this in the spike, not in production.
  • No jitter / identical schedules — correlated retry storms degrading recovery.

Ramp-up. Low for the domain, moderate for the integration. One engineer can read the entire source in under a day; the adapter, tests, and decision record are another one to two days. Total cost of adoption is approximately three to four engineer-days for a capability that is likely 20–40 lines if built in-house. That ratio — combined with 2 stars, 0 dependents, a single maintainer, and an anomalous release date — is the core finding: the capability is worth having, this package is not the cheapest way to get it. Recommend the two-day spike with a strong prior toward building the backoff strategy internally behind our own interface, keeping this package as a documented reference implementation.

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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource