This package extends the laravel provided route list command into php artisan route:compact-list
and lists everything more compact and hides some first-party package url's.
You can install the package via composer:
composer require dutchcodingcompany/laravel-compact-route-list
As the command extends the default route list command, all those options are available. It is intentional the older short middleware style is used.
By default the compact-list command filters all nova
, horizon
and debugbar
routes. There are flags (with the same name) to enable some or all of them.
php artisan route:compact-list --nova
includes nova routesphp artisan route:compact-list --horizon
includes horizon routesphp artisan route:compact-list --debugbar
includes debugbar routesphp artisan route:compact-list --without-filter
does not filter any routes
One can add extra filters:
// adds php artisan route:compact-list --api
CompactRouteList::addFilter('api'); // adds ['api' => 'api] to filters
// adds php artisan route:compact-list --api
// adds php artisan route:compact-list --api-v2
CompactRouteList::addFilters([
'api',
'old-api' => ['api/v1', 'api/v2'],
]);
// adds php artisan route:compact-list --api-v1
CompactRouteList::setFilters([
'api-v1' => 'api/v1',
]); // removes all existing filters and only uses new filters
Also, one can change how the filter is applied by setting a callback
// this is the default callback
CompactRouteList::setFilterCallback(static function (array $route, $filter): bool {
return \Illuminate\Support\Str::contains($route['uri'], $filter);
});
The MIT License (MIT). Please see License File for more information.