From badd7811af7a11190a6f68818c210b1511123810 Mon Sep 17 00:00:00 2001 From: Jeremy Kenedy Date: Thu, 6 Apr 2017 01:54:05 -0700 Subject: [PATCH] Added ability to publish log.blade.php (#87) * Update LaravelLogViewerServiceProvider.php Added ability to publish log.blade.php into `/resources/views/vendor/laravel-log-viewer/` Can be published with ``` php artisan vendor:publish --provider="Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider" --tag=views ``` * Update README.md --- README.md | 6 ++++++ .../LaravelLogViewer/LaravelLogViewerServiceProvider.php | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/README.md b/README.md index 58bbccd..541c0bc 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,12 @@ Route::get('logs', '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index'); Go to `http://myapp/logs` or some other route +**Optionally** publish `log.blade.php` into `/resources/views/vendor/laravel-log-viewer/` for easy customization: + +``` +php artisan vendor:publish --provider="Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider" --tag=views +``` + Install (Lumen) --------------- diff --git a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewerServiceProvider.php b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewerServiceProvider.php index 580ee76..0578d50 100644 --- a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewerServiceProvider.php +++ b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewerServiceProvider.php @@ -25,6 +25,12 @@ public function boot() if (method_exists($this, 'loadViewsFrom')) { $this->loadViewsFrom(__DIR__.'/../../views', 'laravel-log-viewer'); } + + if (method_exists($this, 'publishes')) { + $this->publishes([ + __DIR__.'/../../views' => base_path('/resources/views/vendor/laravel-log-viewer'), + ], 'views'); + } } /**