wangchristine / route-list by wangchristine

This package can list all routes just as Laravel do.
4
2
1
Package Data
Maintainer Username: wangchristine
Package Create Date: 2022-10-25
Package Last Update: 2022-11-03
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-10-26 15:02:06
Package Statistics
Total Downloads: 4
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 2
Total Watchers: 1
Total Forks: 0
Total Open Issues: 0

Lumen Route List

This package can list all routes just as Laravel do.

example-route

Installation

Install by composer

    $ composer require chhw/route-list

In bootstrap/app.php, you should:

  1. add $app->register(CHHW\RouteList\RouteListServiceProvider::class);

Usage

Just like the way to use Laravel !

php artisan route:list
options:
      --json                       Output the route list as JSON
      --method[=METHOD]            Filter the routes by method
      --name[=NAME]                Filter the routes by name
      --path[=PATH]                Only show routes matching the given path pattern
      --except-path[=EXCEPT-PATH]  Do not display the routes matching the given path pattern
  -r, --reverse                    Reverse the ordering of the routes
      --sort[=SORT]                The column (method, uri, name, action, middleware) to sort by [default: "uri"]
      --except-vendor              Do not display routes defined by vendor packages
      --only-vendor                Only display routes defined by vendor packages
  -h, --help                       Display help for the given command. When no command is given display help for the list command
  -q, --quiet                      Do not output any message
  -V, --version                    Display this application version
      --ansi|--no-ansi             Force (or disable --no-ansi) ANSI output
  -n, --no-interaction             Do not ask any interactive question
      --env[=ENV]                  The environment the command should run under
  -v|vv|vvv, --verbose             Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Route Example

<?php

$router->get('/', function () use ($router) {
    return $router->app->version();
});

$router->get('minion', ["as" => "mini", 'uses' => 'ExampleController@mini']);

$router->group(['middleware' => ['ExampleMiddleware', 'Authenticate'], 'namespace' => 'YY', 'prefix' => 'DD', "as" => "admin"], function () use ($router) {
    $router->get('showVersion', function () use ($router) {
        return $router->app->version();
    });

});

$router->group(["as" => "test"], function () use ($router) {
    $router->get('vendor', ["as" => "vendor", "uses" => "\Test\Controllers\TestController@vendor"]);
});