diff --git a/README.md b/README.md index 4be1f61..b289002 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ $dynamicLink = new yedincisenol\DynamicLinks\DynamicLinks([ composer require "yedincisenol/dynamic-links" ``` -- Add service provider (For Laravel 5.3) +- Add service provider (For Laravel 5.6 before) `config/app.php` ```php diff --git a/composer.json b/composer.json index a3c5b9f..565cafc 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "php firebase", "php" ], - "version": "1.2.3", + "version": "1.2.4", "license": "MIT", "authors": [ { diff --git a/src/DynamicLinks.php b/src/DynamicLinks.php index 87c9549..658c908 100644 --- a/src/DynamicLinks.php +++ b/src/DynamicLinks.php @@ -22,8 +22,8 @@ class DynamicLinks */ public function __construct(array $config = null) { - if ($config == null) { - $config = require_once 'config.php'; + if ($config == null && function_exists('config')) { + $config = config('dynamiclinks'); } if ($config == null || !isset($config['api_key']) || strlen($config['api_key']) < 1) { diff --git a/src/LaravelServiceProvider.php b/src/LaravelServiceProvider.php index d859cb2..079f884 100644 --- a/src/LaravelServiceProvider.php +++ b/src/LaravelServiceProvider.php @@ -39,7 +39,7 @@ public function boot() public function register() { $this->app->singleton('DynamicLinks', function ($app) { - return new DynamicLinks($app['config']['dynamiclinks']); + return new DynamicLinks(); }); $this->app->alias('DynamicLinks', DynamicLinks::class);