From bdd3bc6c350d4ba752c934503019b804f40ad9f7 Mon Sep 17 00:00:00 2001 From: Shad Date: Mon, 15 Feb 2016 13:56:39 +0200 Subject: [PATCH] Workaround to support Lumen As Lumen does not provide a `config_path` method, this requires some workaround to support it. --- src/Bican/Roles/RolesServiceProvider.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Bican/Roles/RolesServiceProvider.php b/src/Bican/Roles/RolesServiceProvider.php index 95e4471..a831111 100644 --- a/src/Bican/Roles/RolesServiceProvider.php +++ b/src/Bican/Roles/RolesServiceProvider.php @@ -13,9 +13,13 @@ class RolesServiceProvider extends ServiceProvider */ public function boot() { - $this->publishes([ - __DIR__ . '/../../config/roles.php' => config_path('roles.php') - ], 'config'); + $configPath = __DIR__ . '/../../config/roles.php'; + if (function_exists('config_path')) { + $publishPath = config_path('roles.php'); + } else { + $publishPath = base_path('config/roles.php'); + } + $this->publishes([$configPath => $publishPath], 'config'); $this->publishes([ __DIR__ . '/../../migrations/' => base_path('/database/migrations')