From 46b322385d7bc45b75019dc80d19bad65c0a10f7 Mon Sep 17 00:00:00 2001 From: Micheal Mand Date: Tue, 20 Mar 2018 15:24:28 -0600 Subject: [PATCH] Fix config_path issue (#130) Fixes #126 Lumen does not have a `config_path` helper, so we have to make our own. Thanks to https://gist.github.com/mabasic/21d13eab12462e596120#gistcomment-2140273 for the correct method to get the config path for Lumen. --- .../LaravelLogViewerServiceProvider.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewerServiceProvider.php b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewerServiceProvider.php index 77dcf7f..18114b3 100644 --- a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewerServiceProvider.php +++ b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewerServiceProvider.php @@ -31,7 +31,7 @@ public function boot() __DIR__.'/../../views' => base_path('/resources/views/vendor/laravel-log-viewer'), ], 'views'); $this->publishes([ - __DIR__.'/../../config/logviewer.php' => config_path('logviewer.php'), + __DIR__.'/../../config/logviewer.php' => $this->config_path('logviewer.php'), ]); } @@ -56,5 +56,16 @@ public function provides() { return array(); } + + /** + * Get the configuration path. + * + * @param string $path + * @return string + */ + private function config_path($path = '') + { + return function_exists('config_path') ? config_path($path) : app()->basePath() . DIRECTORY_SEPARATOR . 'config' . ($path ? DIRECTORY_SEPARATOR . $path : $path); + } }