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

Product Decisions This Supports

Feature scoping: retry/backoff as an enabling capability, not a headline feature. The package answers one narrow question — "when should the next attempt happen?" — so it informs whether reliability work is a differentiator or table stakes. For most B2B/API-integration products, deterministic backoff with jitter is table stakes; budget it as an enabler for things like webhook delivery, third-party API calls, notification fan-out, and async job retries, not as a roadmap item a customer would pay for.

Build vs. buy vs. borrow. This is a small algorithmic component (next-attempt timestamps from attempt count and policy). The scoring signals (2 stars, 0 dependents, low opportunity) say the ecosystem does not treat this as a hard problem, so treat the package as a reference implementation and vocabulary source first, and a dependency second. The realistic options:

  • Borrow (recommended default): vendor the algorithm or reimplement ~50–150 lines in-house so the retry policy is owned, testable, and free of a third-party upgrade path.
  • Buy (adopt the package): justified when you want the edge-case coverage (jitter, cap/ceiling, exhaustion, overflow-safe timestamp math) without writing and maintaining the test suite for it, and you accept a single-maintainer dependency on a non-critical path.
  • Build later: if your retry logic needs to be distributed (shared attempt counters across workers) or durable (surviving deploys), the package alone will not get you there; you'd be building a retry-state store anyway.

Architecture decision: keep retry policy behind an interface. Whatever the choice, the PM-relevant outcome is that the "when is the next attempt?" decision is a swappable seam — one class behind a RetryPolicy-style contract. That converts a low-reversibility decision (baked-in time math scattered across jobs) into a high-reversibility one, and lets you change strategy per integration (aggressive for internal services, slow-and-jittered for rate-limited vendors).

Roadmap input for reliability/SLA commitments. If you're publishing delivery guarantees ("webhooks retried with exponential backoff for 24h"), the policy becomes an externally visible contract. That is a product commitment, not an implementation detail — the package can supply the math, but the policy (max attempts, total window, jitter, dead-letter behavior) needs a product owner and documentation.

Risk/portfolio decision. Low adoption plus a single maintainer means this should not sit on a critical path. Acceptable on secondary paths (email retry, analytics sync, non-critical webhooks); not acceptable as the only thing between you and lost payments or lost orders.

When to Consider This Package

Reasonable fit when:

  • You need one well-defined, stateless calculation: given attempt N and a policy, return the next retry timestamp.
  • You already run Laravel/Symfony and are comfortable pulling a Symfony-style component into a Laravel app (Laravel already ships Symfony components, so dependency overlap is low-risk).
  • The retry logic is a secondary path where a small, MIT-licensed dependency and its upgrade cadence are tolerable.
  • You want a working, tested reference whose naming and concepts you can adopt even if you write your own implementation.
  • You value the maintenance signals in the repo (Dockerized dev, multi-PHP/multi-Symfony CI matrix, SonarCloud) as a proxy for "small but conscientiously kept," and are willing to pin a version.

Look elsewhere (or implement in-house) when:

  • Laravel-native primitives already cover it. Queued jobs have backoff(), retryUntil(), and maxExceptions; the scheduler and RateLimiter cover most throttling. If your need is "retry this job with backoff," adopting a package adds a dependency for something the framework does.
  • You need durable or distributed retry state — shared attempt counters, cross-worker coordination, visibility into pending retries, manual replay. This package is a calculator; you need a store plus a scheduler.
  • You need circuit breaking, bulkheads, or rate limiting rather than scheduling. Combine, don't substitute.
  • Vendor/SLA or security review is mandatory. Two stars and zero dependents will not clear most dependency-review gates without an exception; that's a real cost measured in meetings.
  • You need a supported, versioned API with a deprecation policy. Single maintainer and a young version history (latest release 2026-03-21) mean breaking changes are a personal courtesy, not a contract.
  • The team can't afford another upgrade chore. Every dependency on a low-traffic package is a small recurring tax at framework-upgrade time.

Before committing, run a two-day spike: read the actual algorithm and tests, verify behavior at attempt 0/1, at the cap, and past exhaustion; check integer overflow and overflow-safe timestamp handling; confirm jitter is present and configurable; confirm no hidden container/global state; confirm the PHP version floor matches your runtime. If the spike is longer than writing it yourself, the build-vs-buy answer is settled.

How to Pitch It (Stakeholders)

To executives (one paragraph): This is a small, free (MIT), single-purpose utility that calculates when to retry something that failed — the timing logic behind webhook redelivery and third-party API retries. It is not a product feature and not a customer-visible differentiator; it's plumbing that prevents us from hand-rolling retry timing, where subtle mistakes (no jitter, unbounded growth, overflow) turn into thundering-herd incidents and duplicated charges. Cost is zero in license fees and near-zero in integration; the real cost is a low-adoption, single-maintainer dependency. Recommendation: adopt on secondary paths behind our own interface, or reimplement — either way we own the policy and can swap the implementation in an afternoon. No headcount, no schedule impact, and it de-risks a class of reliability bugs we would otherwise only find in production.

To engineering (the substance): The package computes the time of the next retry for fault-tolerant flows — a stateless "given attempt count and policy, return next attempt time" calculator. Treat it as a replaceable seam: wrap it in a thin RetryPolicy contract in our domain, so no job or client calls it directly. That gives us (a) a one-file swap if the package stalls, (b) per-integration policies, and (c) a single place to unit-test edge cases: first retry, cap ceiling, exhaustion, overflow at large attempt counts, and jitter distribution. Where Laravel's queue backoff()/retryUntil() already express the policy, prefer the framework and use this only where we need the calculation outside a queue context (synchronous HTTP clients, schedulers, custom workers). Pin the version, add a smoke test asserting monotonic growth and bounded max delay, and note in the ADR that this is a low-adoption dependency accepted for a non-critical path only.

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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
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