guhemama/http-precondition-bundle
Symfony bundle for handling HTTP precondition headers such as If-Match, If-None-Match, If-Modified-Since, and If-Unmodified-Since. Helps controllers return correct 304 or 412 responses and enforce optimistic concurrency without repetitive header logic.
can: gate bindings, route groups, throttle). So for our primary stack the build-vs-buy question is already settled in favor of "native, no new dependency."Consider adopting (or forking) only if:
Look elsewhere when:
Route::middleware([...]), gate-backed can: middleware, route groups, and throttle cover this. Adding a Symfony bundle to a Laravel app is the wrong shape and the wrong dependency.access_control config, or #[IsGranted] — these are supported, maintained, and documented.To executives: This is a small, MIT-licensed Symfony bundle that lets a route declare preconditions evaluated before the controller runs. It is inexpensive to evaluate and cheap to walk away from — but it carries essentially no market signal: two stars, zero dependents, and no release since January 2023. My recommendation is not to adopt it as a dependency. Instead, approve a one-day engineering spike to replicate the precondition pattern inside our existing middleware layer, which gets us the declarative route-gating capability with no third-party maintenance exposure. It's not on our stack anyway (Symfony component, not Laravel), so the native path is strictly better.
To engineering: The idea is the asset, not the code. It shows a clean way to attach a precondition to a route and short-circuit before the controller — useful if we want gating to be visible at the route definition instead of buried in middleware. In Laravel we already have the mechanics (middleware, can:, route groups), so the work is defining a small RoutePrecondition contract and wiring it as middleware, not importing a bundle. Treat the repo as a reference implementation; if we do end up on raw HttpKernel somewhere, fork it under our own maintenance with a named owner, because upstream is dormant.
How can I help you explore Laravel packages today?