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
Deny Routes By Env Bundle

Deny Routes By Env Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

This bundle for Symfony allows you to deny some routes for a specific environment.

Frequently asked questions about Deny Routes By Env Bundle
Is grizzlylab/deny-routes-by-env-bundle a Laravel package?
No. It is a Symfony bundle that provides a Bundle subclass, a DependencyInjection extension, and a kernel.request event listener. None of those integration points map to Laravel's service container, package discovery, or HTTP kernel. For Laravel, implement the same behavior as a middleware.
How do I install grizzlylab/deny-routes-by-env-bundle in Laravel?
You cannot meaningfully install it in Laravel. Composer may fetch the code, but Laravel does not register Symfony bundles, so the listener and configuration tree will never run. There is no service provider or middleware hook for it to attach to.
Can I use this Symfony bundle to deny routes in Laravel production?
No. The bundle hooks into Symfony's kernel.request event and route resolution, which Laravel does not dispatch. Any deny list you configure would not be enforced. Use Laravel middleware with $request->route()->getName() and app()->environment() instead.
What does grizzlylab/deny-routes-by-env-bundle actually do?
It denies configured routes outside allowed environments, for example keeping dev-only or admin routes unreachable in production. It is a narrow access-control utility for Symfony applications. It compares the matched route against an environment-scoped deny list and aborts before the controller runs.
How do I deny routes by environment in Laravel?
Create a middleware that checks app()->environment() and the current route name via $request->route()->getName(). If the route is on the deny list for that environment, call abort(404) before the controller executes. Register it globally in bootstrap/app.php on Laravel 11+ or in app/Http/Kernel.php on older versions. This is a roughly 30-line reimplementation of the Symfony bundle's behavior.
Is deny-routes-by-env-bundle safe for production access control?
Treat it cautiously. The package has very low adoption (4 stars, no dependents) and a single maintainer. Its failure mode is fail-open: if the listener priority is wrong, the route cache is stale, or the environment is misdetected, deny rules silently do nothing. There is no evidence of a fail-closed contract or CI coverage proving otherwise.
What are alternatives to grizzlylab/deny-routes-by-env-bundle for Laravel?
Build a first-party middleware. Laravel already provides app()->environment(), route name resolution, abort(), and Route::middleware(). A custom DenyRoutesInEnvironment middleware backed by a config/route-deny.php file covers the same use case without a Symfony dependency. You can also use environment checks inside route groups in routes/web.php.
Which Laravel versions support this package?
None. It is a Symfony bundle, not a Laravel package, so it has no Laravel version support matrix. If you need this behavior, implement it natively; the middleware approach works on Laravel 8 and above and is especially clean on Laravel 11+ with bootstrap/app.php.
How do I configure denied routes per environment in Symfony with this bundle?
You configure an environment-keyed deny list in the bundle's configuration tree, typically under config/packages/. The bundle's DependencyInjection extension processes it, and the kernel.request listener enforces it. Verify whether matching is by route name or path pattern, and whether the deny list is compiled at cache warmup or evaluated at runtime.
Does grizzlylab/deny-routes-by-env-bundle have tests and CI?
The available metadata shows no evidence of a test suite or CI pipeline. Adoption is near zero (4 stars, no dependents), so edge cases around sub-requests, ESI fragments, console and messenger contexts, and trailing slashes are unlikely to have been shaken out. Treat the package as a specification rather than a dependency.
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.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib