Created
July 13, 2018 11:17
-
-
Save depsimon/56db4f422147eb796de0c83679db151c to your computer and use it in GitHub Desktop.
route:summary Summary of all registered routes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Console; | |
use Illuminate\Foundation\Console\RouteListCommand; | |
use Illuminate\Routing\Route; | |
use Symfony\Component\Console\Input\InputOption; | |
class RouteSummaryCommand extends RouteListCommand | |
{ | |
/** | |
* The console command name. | |
* | |
* @var string | |
*/ | |
protected $name = 'route:summary'; | |
/** | |
* The console command description. | |
* | |
* @var string | |
*/ | |
protected $description = 'Summary of all registered routes'; | |
/** | |
* The table headers for the command. | |
* | |
* @var array | |
*/ | |
protected $headers = ['Method', 'URI', 'Name']; | |
/** | |
* Get the route information for a given route. | |
* | |
* @param \Illuminate\Routing\Route $route | |
* @return array | |
*/ | |
protected function getRouteInformation(Route $route) | |
{ | |
return $this->filterRoute([ | |
'method' => implode('|', $route->methods()), | |
'uri' => $route->uri(), | |
'name' => $route->getName(), | |
]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment