Skip to content

Commit

Permalink
Config bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yedincisenol committed Jul 26, 2018
1 parent 9fe9880 commit f24c3b0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
15 changes: 14 additions & 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
- Add service provider (For Laravel 5.3)
`config/app.php`

```php
Expand All @@ -41,6 +41,19 @@ composer require "yedincisenol/dynamic-links"
],
```

- Fill Environments
> copy theese parameters to your project .env and fill
```
FIREBASE_API_KEY=
FIREBASE_DYNAMIC_LINKS_DOMAIN=
```

- Laravel Usage
```
$link = new yedincisenol\DynamicLinks\DynamicLink('http://yeni.co/');
$shortLink = $dynamicLink->create($link, 'UNGUESSABLE');
```

- Publish Config file
Publish Config for Laravel
```$xslt
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.2",
"version": "1.2.3",
"license": "MIT",
"authors": [
{
Expand Down
8 changes: 4 additions & 4 deletions src/LaravelServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ class LaravelServiceProvider extends ServiceProvider
public function boot()
{
$this->publishes([
__DIR__ . '/config.php' => config_path('dynamic-links.php'),
], "dynamic-links");
__DIR__ . '/config.php' => config_path('dynamiclinks.php'),
], "dynamiclinks");

$this->mergeConfigFrom(
__DIR__ . '/config.php', 'dynamic-links'
__DIR__ . '/config.php', 'dynamiclinks'
);

}
Expand All @@ -39,7 +39,7 @@ public function boot()
public function register()
{
$this->app->singleton('DynamicLinks', function ($app) {
return new DynamicLinks($app['config']['dynamic-links']);
return new DynamicLinks($app['config']['dynamiclinks']);
});

$this->app->alias('DynamicLinks', DynamicLinks::class);
Expand Down
4 changes: 2 additions & 2 deletions src/config.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

return [
'api_key' => null, #Firebase Project Web Api Key
'dynamic_link_domain' => null
'api_key' => env('FIREBASE_API_KEY', null), #Firebase Project Web Api Key
'dynamic_link_domain' => env('FIREBASE_DYNAMIC_LINKS_DOMAIN')
];

0 comments on commit f24c3b0

Please sign in to comment.