Skip to content

Commit

Permalink
Merge pull request #11 from andypa/master
Browse files Browse the repository at this point in the history
Add possibility to display log files, based on a regex
  • Loading branch information
KABBOUCHI authored Nov 15, 2019
2 parents 3ccafbd + 5d87819 commit d7e6e4d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ public function tools()

Click on the "nova-logs-tool" menu item in your Nova app to see the tool provided by this package.

Possible environment variables:

``` env
NOVA_LOGS_PER_PAGE=6
NOVA_LOGS_REGEX_FOR_FILES="/^laravel/"
```

### Testing

``` bash
Expand Down
1 change: 1 addition & 0 deletions config/nova-logs-tool.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

return [
'perPage' => env('NOVA_LOGS_PER_PAGE', 6),
'regexForFiles' => env('NOVA_LOGS_REGEX_FOR_FILES', '/^laravel/')
];
2 changes: 1 addition & 1 deletion src/Http/Controllers/LogsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function index()
public function dailyLogFiles()
{
return collect(Ward::getFiles(true))->filter(function ($file) {
return strpos($file, 'laravel') === 0;
return preg_match(config('nova-logs-tool.regexForFiles'), $file);
})->values()->all();
}

Expand Down

0 comments on commit d7e6e4d

Please sign in to comment.