diff --git a/CHANGELOG.md b/CHANGELOG.md index d2b57ec..508218c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to `route-usage` will be documented in this file +## 0.2 +**28 Oct 2019** | [git diff 0.1..0.2](https://github.com/julienbourdeau/route-usage/compare/0.1..0.2) + +* Ignore OPTIONS http calls - PR [#12](https://github.com/julienbourdeau/route-usage/pull/12) + +* Ignore routes based on their name or uri - PR [#6](https://github.com/julienbourdeau/route-usage/pull/6) + +* Add style for HTML view - PR [#8](https://github.com/julienbourdeau/route-usage/pull/8) + ## 0.1 - initial release diff --git a/README.md b/README.md index dedb1fb..852d2c7 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,9 @@ After a few years, any projects have dead code and unused endpoint. Typically, y Have look at the `route_usage` table and figure out when this page was accessed for the last time. Last week? Better keep it for now. 3 years ago? REMOVE THE CODE! 🥳 -Screenshot 2019-10-20 at 19 14 39 +/route-usage screenshot -Screenshot 2019-10-20 at 19 15 19 +php artisan usage:route screenshot ## Installation @@ -21,12 +21,25 @@ You can install the package via composer: composer require julienbourdeau/route-usage ``` -Run migrations: +Run migrations to create the new `route_usage` table. ```bash php artisan migrate ``` +Publish configuration + +```bash +php artisan vendor:publish --provider="Julienbourdeau\RouteUsage\RouteUsageServiceProvider" +``` + +## Configuration + +### excluding-regex + +Here you may specify regex to exclude routes from being logged. +Typically, you want may want to exclude routes from packages or dev controllers. +The value must be a valid regex or anything falsy. ## Usage @@ -38,7 +51,6 @@ Head over to `yourapp.tld/route-usage`. Please note that this page is publicly a * The page showing route usage is **currently publicly available**. (see TODO) * I only logs request with a 2xx or 3xx HTTP response. I don't think the rest makes sense. Your opinion is welcome! * In the very first version, I was incrementing a `count` attribute. I removed it because I think it gives a wrong information. If it was used a lot because but last access was a year ago, it gives a false sense of importance to this unused route. -* The HTML page with the table is volontarily not using any CSS: I want it to be very low footprint and as easy as possible to maintain. ## Todo diff --git a/config/config.php b/config/config.php index 39bd642..47c915b 100644 --- a/config/config.php +++ b/config/config.php @@ -7,9 +7,10 @@ | Exclude requests based on route name or uri |-------------------------------------------------------------------------- | - | Here you may specify which of the database connections below you wish - | to use as your default connection for all database work. Of course - | you may use many connections at once using the Database library. + | Here you may specify regex to exclude routes from being logged. Typically, + | you want may want to exclude routes from packages or dev controllers. + | + | The value must be a valid regex or anything falsy. | */ @@ -17,4 +18,5 @@ 'name' => '/^(route-usage|nova|debugbar|horizon)\./', 'uri' => '' ], + ];