PHPackages                             louisstanley/ci4-route-checker - 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. [CLI &amp; Console](/categories/cli)
4. /
5. louisstanley/ci4-route-checker

ActiveLibrary[CLI &amp; Console](/categories/cli)

louisstanley/ci4-route-checker
==============================

A CodeIgniter 4 CLI command to check routes

23.0k↓50%PHP

Since Mar 27Pushed 1y ago2 watchersCompare

[ Source](https://github.com/LouisStanley/ci4-route-checker)[ Packagist](https://packagist.org/packages/louisstanley/ci4-route-checker)[ RSS](/packages/louisstanley-ci4-route-checker/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

CI4 Route Checker
=================

[](#ci4-route-checker)

Overview
--------

[](#overview)

`Ci4RouteChecker` is a CodeIgniter 4 CLI command that checks all defined routes for missing controllers, methods, and potential issues. It helps developers identify incorrect route configurations in their applications.

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

[](#requirements)

- CodeIgniter 4.3+
- PHP 7.4+

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

[](#installation)

You can install this package via Composer:

```
composer require louisstanley/ci4-route-checker
```

After installation, the command will be available for use within your CodeIgniter 4 project.

Usage
-----

[](#usage)

Run the following command in your project root to check all defined routes:

```
php spark routes:check
```

Features
--------

[](#features)

- Checks for missing controllers.
- Checks for missing methods in controllers.
- Detects closure-based routes (currently marked as warnings).
- Identifies mismatches in method parameter counts (can be configured as a warning or error).
- Displays warnings and errors in a structured format.

Configuration
-------------

[](#configuration)

`Ci4RouteChecker` now supports configuration via a publishable config file. You can publish the configuration file with:

```
php spark routes:publish-checker-config
```

This will create a config file at `app/Config/RouteChecker.php` where you can modify settings as needed.

### Available Configuration Options

[](#available-configuration-options)

The published configuration file includes the following options:

```
