Skip to content

Instantly share code, notes, and snippets.

@depsimon
Created July 13, 2018 11:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save depsimon/56db4f422147eb796de0c83679db151c to your computer and use it in GitHub Desktop.
Save depsimon/56db4f422147eb796de0c83679db151c to your computer and use it in GitHub Desktop.
route:summary Summary of all registered routes
<?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