Add ability to exclude routes
See original GitHub issueLet’s say I have some super secret endpoints (/admin/whatever), I’d like to be able to exclude them from the routes that are exposed via the generated JSON.
Maybe this can be achieved by adding a middleware, like how aaronlord/laroute does it.
As an extension of this, it’d be neat if I could use route groups to only expose certain routes to a “named” group, so I could use @routes('admin') in my blade file(s) to only expose routes in the admin group.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:16 (10 by maintainers)
Top Results From Across the Web
Add ability to exclude routes · Issue #16 · tighten/ziggy - GitHub
Let's say I have some super secret endpoints ( /admin/whatever ), I'd like to be able to exclude them from the routes that...
Read more >PM77489: ADD ABILITY TO EXCLUDE SPECIFIC SYSTEMS FROM ...
ROUTE command is used to start the AUIU address space on all systems in a sysplex. The AUIU address space requires certain datasets...
Read more >ruby on rails - Add constraint to route to exclude certain keyword
I am using Rails and I want to use contraint in route to exclude that route if keyword "incident" is ...
Read more >Add option to exclude admin routes [#3232306] | Drupal.org
Problem/Motivation It's already possible to exclude certain paths, but it would be useful to be able to exclude all admin paths with one...
Read more >Is it possible to use "route ADD ... MASK ..." command to ...
Routing works based on the destination IP address, it doesn't care or even know which application is trying to reach it. You can...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

In case y’all weren’t thinking this, I’d consider using Laravel’s regex matcher that allows for shortcuts like “api.*”" – the thing that is sourced by “Str::is”
@mikemand and @ctf0
Okay I have a compromise for you guys. I don’t like publishing a config file by default, but I don’t mind having an optional config file.
What if we publish all routes by default, then add support for optional
config('ziggy.whitelist')andconfig('ziggy.blacklist')settings.That way average users who don’t care won’t have to worry about black/white-listing routes, but if someone wants to do that, they have the option of just creating a
config/ziggy.phpfile and adding one of those settings?I’m thinking the setting could be an array of regular expressions, i.e. -
This way it would be relatively simple to target entire route namespaces, or “any
deleteendpoint” or whatever.How does that sit with y’all?