From f24c3b0e3784220366466e79ec7b56c62a93287b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0brahim=20=C5=9E=2E=20=C3=96rencik?= Date: Thu, 26 Jul 2018 18:42:02 +0300 Subject: [PATCH] Config bug fix --- README.md | 15 ++++++++++++++- composer.json | 2 +- src/LaravelServiceProvider.php | 8 ++++---- src/config.php | 4 ++-- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6ab90d3..4be1f61 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/composer.json b/composer.json index d0607ef..a3c5b9f 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "php firebase", "php" ], - "version": "1.2.2", + "version": "1.2.3", "license": "MIT", "authors": [ { diff --git a/src/LaravelServiceProvider.php b/src/LaravelServiceProvider.php index cc6fe29..d859cb2 100644 --- a/src/LaravelServiceProvider.php +++ b/src/LaravelServiceProvider.php @@ -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' ); } @@ -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); diff --git a/src/config.php b/src/config.php index 4c2500c..36392f1 100644 --- a/src/config.php +++ b/src/config.php @@ -1,6 +1,6 @@ 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') ]; \ No newline at end of file