Skip to content

Implement route:list CLI command for Quantum modules #349

Description

@armanist

Description
Create a new CLI command php qt route:list to display all registered routes in the application, taking into account Quantum’s modular architecture. Only module-defined routes exist; core does not register routes.

Requirements

Command Name:

route:list

Functionality:

  • List all routes from all loaded modules.
  • Display the following columns:
    • HTTP Method(s)
    • URI
    • Action (Controller::method)
      -Module name
    • Middleware (if assigned)

CLI Output:

ASCII table format, example:

+--------+-------------------+------------------------+-------------+----------------+
| Method | URI | Action | Module | Middleware |
+--------+-------------------+------------------------+-------------+----------------+
| GET | /admin/dashboard | DashboardController@index | Admin | auth, admin |
| GET | /blog | BlogController@index | BlogModule | web |
| POST | /blog/comment | CommentController@store | BlogModule | auth |
+--------+-------------------+------------------------+-------------+----------------+

Filtering / Extensibility:

Optional CLI flags for future:
--module= → show routes for a specific module

Error Handling:

If no routes exist in modules, display:
"No routes found in any loaded module."

Testing:

  • Verify multiple modules’ routes are listed correctly.
  • Verify empty modules are handled gracefully.
  • Check formatting and CLI output correctness.

Acceptance Criteria:

  • Running php qt route:list lists all routes from modules only.
  • Output clearly shows Module, URI, Method, Action, Middleware.
  • Handles modules with no routes without errors.
  • CLI command follows Quantum naming conventions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions