panchodp/frog-uri
Composer 安装命令:
composer require --dev panchodp/frog-uri
包简介
Inspect,check and review the middlewares applies to your uri's in Laravel.
README 文档
README
Important
Caution: This package is a work in progress and may not be production-ready. Use at your own risk.
Inspect, check, review and filter Laravel middlewares applied to your routes.
FrogUri is a powerful Laravel package that helps you analyze your application's routing structure, identify security vulnerabilities, and understand middleware distribution across your routes.
Installation
Install the package via Composer:
composer require panchodp/frog-uri --dev
The package will automatically register itself via Laravel's package discovery.
Usage
Basic Analysis
Analyze all your application routes and get detailed information about middlewares:
php artisan frog:analyze
This command will show you:
- Total number of routes
- Middleware distribution
- Routes summary and statistics
Security Analysis (Danger Mode)
Identify potentially vulnerable routes without middleware protection:
php artisan frog:analyze --danger
This will display:
- �� Routes without any middleware (potential security risks)
- Formatted list with HTTP methods, URIs, and controllers
- Security recommendations
Interactive Route Filtering
Filter and analyze routes interactively with the new frog:filter command:
php artisan frog:filter
Features:
- 📋 Interactive middleware selection with numbered table interface
- 🎯 Flexible filtering options: Select individual middlewares (1,3,5) or all middlewares
- 🚫 Exclude mode for security audits:
php artisan frog:filter --exclude - 📊 Visual results with organized route information
Include Mode (Default)
Shows routes that HAVE the selected middlewares:
php artisan frog:filter
# Select middleware numbers to see routes WITH those middlewares
Exclude Mode (Security Audits)
Shows routes that DO NOT HAVE the selected middlewares:
php artisan frog:filter --exclude
# Select middleware numbers to find routes WITHOUT those middlewares
Common Security Use Cases:
# Find routes without authentication php artisan frog:filter --exclude # Select "auth" to find unprotected routes # Find routes without rate limiting php artisan frog:filter --exclude # Select "throttle" to find routes without rate limiting # Find routes without both auth and admin protection php artisan frog:filter --exclude # Select "auth,admin" to find vulnerable admin routes
Features
RouteCollection API
The package provides a powerful RouteCollection class for programmatic route analysis:
use FrogUri\Actions\GetJsonAction; use FrogUri\Actions\MappingAction; // Get route data $jsonData = GetJsonAction::handle(); $collection = MappingAction::handle($jsonData); // Filter by middleware $authRoutes = $collection->filterByMiddleware('auth'); $multipleMiddlewares = $collection->filterByMiddleware(['auth', 'verified']); // Filter by HTTP method $getRoutes = $collection->filterByMethod('GET'); $postRoutes = $collection->filterByMethod(['POST', 'PUT']); // Chain filters $secureApiRoutes = $collection ->filterByUri('api/*') ->filterByMiddleware('auth') ->filterByMethod('GET'); // Security analysis $vulnerableRoutes = $collection->getRoutesWithoutMiddleware(); $dangerousRoutes = $collection->getDangerousRoutes(); // NEW: Exclude filtering for security audits $unprotectedRoutes = $collection->excludeByMiddleware('auth'); $noRateLimitRoutes = $collection->excludeByMiddleware(['throttle', 'rate_limit']); $adminRoutesWithoutAuth = $collection ->filterByUri('admin/*') ->excludeByMiddleware('auth');
Available Filter Methods
| Method | Description | Example |
|---|---|---|
filterByMiddleware() |
Filter routes by middleware | $collection->filterByMiddleware('auth') |
excludeByMiddleware() |
NEW Exclude routes with middleware | $collection->excludeByMiddleware('auth') |
filterByMethod() |
Filter routes by HTTP method | $collection->filterByMethod('POST') |
filterByUri() |
Filter routes by URI pattern | $collection->filterByUri('api/*') |
filterByName() |
Filter routes by route name | $collection->filterByName('admin.*') |
getRoutesWithoutMiddleware() |
Get routes without any middleware | $collection->getRoutesWithoutMiddleware() |
getRoutesWithoutSpecificMiddleware() |
NEW Get routes without specific middleware | $collection->getRoutesWithoutSpecificMiddleware('auth') |
Utility Methods
// Get all unique middlewares $middlewares = $collection->getAllMiddlewares(); // Get all HTTP methods $methods = $collection->getAllMethods(); // Group routes by middleware $groupedByMiddleware = $collection->groupByMiddleware(); // Group routes by HTTP method $groupedByMethod = $collection->groupByMethod(); // Get route count $totalRoutes = $collection->count();
Use Cases
Security Audits
- Interactive filtering with
frog:filter --excludeto find vulnerable routes - Identify routes without authentication middleware
- Find API endpoints missing rate limiting
- Locate admin routes without proper protection
- Bulk security scanning using exclude mode for multiple middlewares
Code Reviews
- Ensure consistent middleware application
- Verify route protection standards
- Document middleware usage patterns
Development
- Debug routing issues
- Understand middleware inheritance
- Validate route configurations
Credits
License
The MIT License (MIT). Please see License File for more information.
panchodp/frog-uri 适用场景与选型建议
panchodp/frog-uri 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 20 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 09 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「command」 「routes」 「middleware」 「uri」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 panchodp/frog-uri 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 panchodp/frog-uri 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 panchodp/frog-uri 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Generates a Blade directive exporting all of your named Laravel routes. Also provides a nice route() helper function in JavaScript.
Block routes by IP
A Wrapper for exec and it's results
Symfony bundle to monitor and execute commands
Provides caching methods which can be easily used for caching routes.
Shell command module for PHP.
统计信息
- 总下载量: 20
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-09-13