Skip to content

Commit b703b0f

Browse files
author
Davi Nunes
committed
Dynamic config support
1 parent 6e5a28d commit b703b0f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Davibennun/LaravelPushNotification/LaravelPushNotificationServiceProvider.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ class LaravelPushNotificationServiceProvider extends ServiceProvider {
1919
*/
2020
public function boot()
2121
{
22+
$config_path = function_exists('config_path') ? config_path('push-notification.php') : 'push-notification.php';
2223
$this->publishes([
23-
__DIR__.'/../../config/config.php' => config_path('push-notification.php')
24+
__DIR__.'/../../config/config.php' => $config_path
2425
], 'config');
2526
}
2627

src/Davibennun/LaravelPushNotification/PushNotification.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ class PushNotification {
44

55
public function app($appName)
66
{
7-
return new App(config('push-notification.'.$appName));
7+
$config = is_array($appName) ? $appName : config('push-notification.'.$appName);
8+
return new App($config);
89
}
910

1011
public function Message()

0 commit comments

Comments
 (0)