Skip to content

Commit

Permalink
Laravel config fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yedincisenol committed Jul 26, 2018
1 parent f24c3b0 commit 5890d04
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"php firebase",
"php"
],
"version": "1.2.3",
"version": "1.2.4",
"license": "MIT",
"authors": [
{
Expand Down
4 changes: 2 additions & 2 deletions src/DynamicLinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/LaravelServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5890d04

Please sign in to comment.