Skip to content

Debug Commands ​

The debug:routes and debug:config commands print what the application actually loaded. Use them to check a route's middlewares or a config value without reading the source. They read the same objects the application uses, so the output matches the running app.

Debugging Routes ​

debug:routes prints every compiled route: its name, methods, pattern, handlers, middlewares, and groups.

bash
php windwalker debug:routes

Tree Output ​

The default output is a tree that follows the group hierarchy. Group nodes show their prefix and the middlewares they add. A route line lists only the middlewares added by the route itself. This excerpt is shortened:

text
└── web [CanonicalizeMiddleware]
    ├── front [...]
    │   ├── article
    │   │   ├── front::article_category GET /articles[/{path:.+}]
    │   │   └── front::article_item GET /article/{id:\d+}-{alias}
    │   └── ...

Output Modes ​

  • No option: the group tree.
  • -t, --table: a flat table, with inherited middlewares included.
  • -d, --detail: the full compiled options of every matched route.
  • --json: the matched routes as JSON.
bash
php windwalker debug:routes -t
php windwalker debug:routes --json

Filtering ​

All filters are case-insensitive substring matches. When you combine filters, a route must match all of them.

  • filter (argument): the route name or pattern.
  • -s, --search: any of name, pattern, handlers, middlewares, and groups.
  • --name and --pattern: match one field only.
  • -m, --middleware: a middleware class name, short or full.
  • --no-middleware: routes that have no middleware at all.
  • -g, --group: a group name.
  • -S, --stage: the part of the route name before ::, such as admin.
  • -M, --method: an HTTP method. Routes without a method restriction match.
  • --handler: a handler string, such as a controller class name.
bash
php windwalker debug:routes article
php windwalker debug:routes -S admin -g dashboard -m Csrf -M POST -t
php windwalker debug:routes --handler DashboardController

TIP

--name, --pattern, and --handler have no short options, because -n, -p, and -H are global console options.

When no route matches, the command prints No routes.

Inspecting Config ​

debug:config prints the config tree. Pass a dot path to print one part of it. Without a path, the command prints everything.

bash
php windwalker debug:config
php windwalker debug:config database.connections.local

Options ​

  • -a, --app: the app whose config to print. The default is main. Use console for the console config, or any name from factories.apps.
  • -s, --search: keep only entries whose path or scalar value contains the keyword. The match is case-insensitive.
  • -D, --depth: the maximum depth to expand. Deeper values are collapsed.
  • -f, --flat: print dot.path = value lines instead of a tree.
  • --json: print the result as JSON.
  • --reveal: show values of sensitive keys instead of masking them.
bash
php windwalker debug:config -s mail
php windwalker debug:config --app=console --flat
php windwalker debug:config -D 2 --json

Sensitive keys, such as password, secret, and token, are masked by default.

WARNING

--reveal prints secrets in plain text. Do not paste its output into a ticket, a chat, or a shared log.

Released under the MIT License.