PHPackages                             mydevnl/audit-routes - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. mydevnl/audit-routes

ActiveLibrary[Testing &amp; Quality](/categories/testing)

mydevnl/audit-routes
====================

Gain insights into the security and protection of your Laravel routes. Audit Routes is your new best friend for keeping your application rock-solid!

v0.2.5-beta(8mo ago)17MITPHPPHP ^8.1CI passing

Since May 30Pushed 7mo agoCompare

[ Source](https://github.com/mydevnl/audit-routes)[ Packagist](https://packagist.org/packages/mydevnl/audit-routes)[ Docs](https://github.com/mydevnl/audit-routes)[ RSS](/packages/mydevnl-audit-routes/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (10)Versions (6)Used By (0)

Audit Routes
============

[](#audit-routes)

This PHP Package provides a streamlined approach to gaining insights into the security and protection of your application's routes. In just a few seconds, you can assess critical aspects such as:

- **Test Coverage:** Comprehensive tests cover all routes to ensure reliability
- **Authentication:** Routes requiring authentication are clearly identified
- **Scoped Bindings:** Nested route models are scoped to maintain data integrity
- **Permissions:** Permission or policy checks enforce access control
- **Middleware:** Essential middleware is applied for security and request handling

[![Latest Stable Version](https://camo.githubusercontent.com/e21997e9bc3ce651e2e4649301e014262b16c1c3b8b038bd64bbe611c19e0b2d/68747470733a2f2f706f7365722e707567782e6f72672f6d796465766e6c2f61756469742d726f757465732f762f737461626c65)](https://packagist.org/packages/mydevnl/audit-routes)[![Total Downloads](https://camo.githubusercontent.com/515b7b75a9c251f4a97d4447061ca2267372792d64c24125698054f31cc3162e/68747470733a2f2f706f7365722e707567782e6f72672f6d796465766e6c2f61756469742d726f757465732f646f776e6c6f616473)](https://packagist.org/packages/mydevnl/audit-routes)[![Coding standards](https://github.com/mydevnl/audit-routes/actions/workflows/coding-standards.yml/badge.svg)](https://github.com/mydevnl/audit-routes/actions/workflows/coding-standards.yml)[![Tests](https://github.com/mydevnl/audit-routes/actions/workflows/run-tests.yml/badge.svg)](https://github.com/mydevnl/audit-routes/actions/workflows/run-tests.yml)[![License](https://camo.githubusercontent.com/51d14cf05ed5bc62a194e299bd573c7e92d879759aea1fd293ed23d0d836f594/68747470733a2f2f706f7365722e707567782e6f72672f6d796465766e6c2f61756469742d726f757465732f6c6963656e7365)](https://packagist.org/packages/mydevnl/audit-routes)

Built for Laravel with extensible architecture for other PHP frameworks.

Requirements
------------

[](#requirements)

- **PHP**: 8.1+

Documentation
-------------

[](#documentation)

Comprehensive documentation is available to help you get the most out of Audit Routes:

### Getting Started

[](#getting-started)

- **[Installation](docs/getting-started/installation.md)** - Install and set up the package
- **[Quick Start](docs/getting-started/quick-start.md)** - Get auditing in under 5 minutes
- **[Configuration](docs/getting-started/configuration.md)** - Customize settings and behavior

### Guides

[](#guides)

- **[Basic Usage](docs/guides/basic-usage.md)** - Essential patterns and common scenarios
- **[Advanced Usage](docs/guides/advanced-usage.md)** - Complex configurations and custom scoring
- **[Custom Auditors](docs/guides/custom-auditors.md)** - Build application-specific security checks
- **[Testing](docs/guides/testing.md)** - PHPUnit assertions and CI integration
- **[CI Integration](docs/guides/ci-integration.md)** - Automate audits in your deployment pipeline
- **[Troubleshooting](docs/guides/troubleshooting.md)** - Resolve common issues

### Reference

[](#reference)

- **API Documentation**
    - **[Assertions](docs/reference/api/assertions.md)** - Integrate route security validation directly into your test suite
    - **[Auditors](docs/reference/api/auditors.md)** - Auditors are the core components that analyze your routes
    - **[Commands](docs/reference/api/commands.md)** - Available Artisan Commands
- **Architecture**
    - **[Auditor system](docs/reference/architecture/auditor-system.md)** - How the auditor system works internally
    - **[Overview](docs/reference/architecture/overview.md)** - Understanding the internal architecture
- **Examples**
    - **[Integrations](docs/reference/examples/integrations.md)** - Integrating with popular PHP frameworks
    - **[Real world](docs/reference/examples/real-world.md)** - Real-world implementation examples

### Community

[](#community)

- **[FAQ](docs/community/faq.md)** - Frequently asked questions
- **[Resources](docs/community/resources.md)** - Additional tools and resources

### Quick Reference

[](#quick-reference)

- **[Quick Reference](docs/quick-reference.md)** - Fast reference for commands and common patterns

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require mydevnl/audit-routes --dev
```

Optionally publish the configuration file:

```
php artisan vendor:publish --tag=audit-routes-config
```

Quick Start
-----------

[](#quick-start)

Get your first audit running in seconds:

```
# Run a basic security audit
php artisan route:audit -vv

# Generate a detailed HTML report
php artisan route:audit-report

# Check authentication coverage
php artisan route:audit-auth -vv
```

For programmatic usage:

```
use MyDev\AuditRoutes\AuditRoutes;
use MyDev\AuditRoutes\Auditors\PolicyAuditor;
use MyDev\AuditRoutes\Auditors\MiddlewareAuditor;

$result = AuditRoutes::for($router->getRoutes())
    ->setBenchmark(50)
    ->run([
        PolicyAuditor::make()->setWeight(25),
        MiddlewareAuditor::make(['auth'])->setWeight(20),
    ]);
```

How It Works
------------

[](#how-it-works)

Audit Routes uses a **scoring system** to evaluate route security:

- **Built-in Auditors**: PolicyAuditor, MiddlewareAuditor, PhpUnitAuditor, and more
- **Configurable Weights**: Customize importance of different security aspects
- **Benchmark System**: Set minimum scores for compliance (routes below benchmark are flagged)
- **Multiple Outputs**: Console, HTML reports, JSON exports for different workflows

Learn more about the [Architecture](docs/reference/architecture/overview.md) and [Auditor System](docs/reference/architecture/auditor-system.md).

Available Commands
------------------

[](#available-commands)

The package provides several built-in commands to help you get started quickly:

- **`route:audit`** - Comprehensive route security analysis
- **`route:audit-report`** - Generate detailed HTML audit reports
- **`route:audit-test-coverage`** - Analyze test coverage for routes
- **`route:audit-auth`** - Focus on authentication middleware analysis

For detailed usage examples and command-line options, see the [Basic Usage Guide](docs/guides/basic-usage.md#command-line-options).

### Quick Reference

[](#quick-reference-1)

```
# Basic audit with detailed output
php artisan route:audit -vv

# High security standards
php artisan route:audit --benchmark 75 -vv

# Generate HTML report
php artisan route:audit-report

# Check authentication coverage
php artisan route:audit-auth -vv

# Verify test coverage
php artisan route:audit-test-coverage --benchmark 1 -vv

# Export results for CI/CD
php artisan route:audit --benchmark 50 --export json --filename security-audit.json
```

Testing Integration
-------------------

[](#testing-integration)

The package includes PHPUnit assertions for integrating route security checks directly into your test suite. Use the `AssertsAuditRoutes` trait to enforce security standards as part of your CI/CD pipeline.

See the [Testing Guide](docs/guides/testing.md) for comprehensive examples and best practices.

Troubleshooting
---------------

[](#troubleshooting)

**Common issues:**

- **No routes found?** Ensure your Laravel application has defined routes and clear route cache: `php artisan route:clear`
- **Permission errors?** Check that `storage/exports/audit-routes/` is writable: `chmod -R 775 storage/`
- **Configuration issues?** Verify your `config/audit-routes.php` settings match your project structure

For detailed troubleshooting and solutions, see the [Troubleshooting Guide](docs/guides/troubleshooting.md) or [FAQ](docs/community/faq.md).

Contributing
------------

[](#contributing)

We welcome contributions to this project! If you have ideas for improvements or find bugs, please submit them as issues on GitHub. We highly appreciate and encourage community participation.

For additional help or questions, feel free to reach out via GitHub issues.

Learn more about [contributing](CONTRIBUTING.md).

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover any security vulnerabilities, please report them immediately. All security-related issues will be addressed with the highest priority.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE.md).

We're still in development
--------------------------

[](#were-still-in-development)

Please be aware that the most stable release is an beta release and may be unstable. The roadmap will be published soon. Follow [mydevnl](https://github.com/mydevnl) to stay updated!

May your routes be flawless! 🔒✨

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance62

Regular maintenance activity

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 89.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~96 days

Total

2

Last Release

250d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/177329a263824fb2a9fb1b628741c8cbccc84909b7dfd511c709243931e21df6?d=identicon)[jimbrouwer](/maintainers/jimbrouwer)

---

Top Contributors

[![jimbrouwer](https://avatars.githubusercontent.com/u/37496481?v=4)](https://github.com/jimbrouwer "jimbrouwer (25 commits)")[![jimbrouwer-w2w](https://avatars.githubusercontent.com/u/70021826?v=4)](https://github.com/jimbrouwer-w2w "jimbrouwer-w2w (3 commits)")

---

Tags

middlewaretestingphpunitlaravelroutessecurityroutingMetricsreportingcode qualitycontinuous integrationAuditRoute AuditingAudit ReportsSecurity ComplianceTest CoveragePermission Checks

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mydevnl-audit-routes/health.svg)

```
[![Health](https://phpackages.com/badges/mydevnl-audit-routes/health.svg)](https://phpackages.com/packages/mydevnl-audit-routes)
```

###  Alternatives

[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[watson/active

Laravel helper for recognising the current route, controller and action

3253.6M14](/packages/watson-active)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
