grizzlylab/deny-routes-by-env-bundle
Symfony bundle that restricts routes to specific environments, letting you deny configured paths outside allowed envs. Simple configuration keeps dev-only or admin routes unreachable in production without touching controllers or firewall rules.
if (app()->environment('local')) checks in controllers.abort(404) unless the current environment is in an allowlist, registered globally or per route group). The PM decision is "we need the control," not necessarily "we need this package."-bundle suffix indicate a Symfony bundle, not a Laravel package. If the team is on Laravel, treat this as design inspiration, not a dependency — Laravel already has App::environment(), route groups, and middleware that cover the same ground idiomatically.For executives: This addresses a recurring, low-cost security failure mode — internal or debug routes left reachable on a staging or demo environment that someone links to a customer or a search engine. The capability is worth having; this specific package is not necessarily how we get it. Recommendation is to fund a small hardening task in the current sprint and treat any third-party implementation as a reference design, given the package's negligible adoption and maintenance signals.
For engineering: The requirement is a middleware (or Symfony listener) that returns 404 for a configurable set of routes unless the current environment is in an explicit allowlist, failing closed on unknown environments. It should be covered by a test that asserts the denial actually happens in production and staging. This package demonstrates the shape of that solution — declarative per-environment deny rules — but at 4 stars and zero dependents, vendoring ~40 lines we own is lower risk than taking a dependency on the request path. If the team is on Symfony and prefers config-owned policy, the package is a reasonable starting point worth a one-hour spike, with a fork-and-own plan.
How can I help you explore Laravel packages today?