Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dutchcodingcompany/laravel-compact-route-list
https://github.com/dutchcodingcompany/laravel-compact-route-list
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dutchcodingcompany/laravel-compact-route-list
- Owner: DutchCodingCompany
- License: mit
- Created: 2020-12-15T14:01:55.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-08-08T09:51:20.000Z (over 1 year ago)
- Last Synced: 2024-10-14T06:27:02.343Z (3 months ago)
- Language: PHP
- Size: 13.7 KB
- Stars: 1
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Compact Route List
[![Latest Version on Packagist](https://img.shields.io/packagist/v/dutchcodingcompany/laravel-compact-route-list.svg?style=flat-square)](https://packagist.org/packages/dutchcodingcompany/laravel-compact-route-list)
[![Total Downloads](https://img.shields.io/packagist/dt/dutchcodingcompany/laravel-compact-route-list.svg?style=flat-square)](https://packagist.org/packages/dutchcodingcompany/laravel-compact-route-list)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.
## Installation
You can install the package via composer:
```bash
composer require dutchcodingcompany/laravel-compact-route-list
```## Options
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 routes
- `php artisan route:compact-list --horizon` includes horizon routes
- `php artisan route:compact-list --debugbar` includes debugbar routes
- `php artisan route:compact-list --without-filter` does not filter any routes## Configure filters
One can add extra filters:
```php
// 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
```php
// this is the default callback
CompactRouteList::setFilterCallback(static function (array $route, $filter): bool {
return \Illuminate\Support\Str::contains($route['uri'], $filter);
});
```## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.