From 74182152ed7a5961087f309b92d495c0298442c8 Mon Sep 17 00:00:00 2001 From: Percy Mamedy Date: Wed, 7 Jun 2017 21:58:10 +0400 Subject: [PATCH] Refactoring composer.json and L5.5 prep works Refactored composer.json. Added L5.5 auto package discovery feature. --- README.md | 15 ++++++++++++++- composer.json | 29 ++++++++++++++--------------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index ddbebeb..9bdfef5 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,11 @@ versions of Tradeoff Analytics. Laravel | Tradeoff Analytics :---------------|:------------------ 5.0.x - 5.3.x | 0.1.x - 5.4.x | 0.2.x + 5.4.x - 5.5.x | 0.2.x + +> If you are using Laravel >= 5.5, you can skip service registration +> and aliases registration thanks to Laravel auto package discovery +> feature. Add the ```WatsonBridgeServiceProvider``` and ```TradeoffAnalyticsServiceProvider``` to your providers array in ```config/app.php```, see [Registering Providers](https://laravel.com/docs/master/providers#registering-providers): @@ -62,6 +66,15 @@ in ```config/app.php```, see [Registering Providers](https://laravel.com/docs/ma ] ``` +You can also add the following alias to you app.php file: + +```php +'aliases' => [ + ... + 'TradeoffAnalytics' => FindBrok\TradeoffAnalytics\Facades\TradeoffAnalytics::class, +] +``` + ### Configuration Once installed you can now publish your config file and set your correct configuration for using the package: diff --git a/composer.json b/composer.json index 51188ab..43b9846 100644 --- a/composer.json +++ b/composer.json @@ -1,15 +1,7 @@ { "name": "findbrok/laravel-tradeoff-analytics", "description": "A simple Laravel 5 Wrapper around IBM Watson Tradeoff Analytics API", - "keywords": [ - "php", - "ibm", - "watson", - "api", - "tradeoff", - "analytics", - "laravel" - ], + "keywords": ["php", "ibm", "watson", "api", "tradeoff", "analytics", "laravel"], "license": "MIT", "authors": [ { @@ -20,15 +12,14 @@ "require": { "php": ">=5.6.0", "findbrok/php-watson-api-bridge": "1.1.*", - "laravel/framework": "~5.4", - "netresearch/jsonmapper": "^1.1", - "jstewmc/php-helpers": "^0.1.1" + "illuminate/support": "~5.4", + "jstewmc/php-helpers": "^0.1.1", + "netresearch/jsonmapper": "^1.1" }, "require-dev": { "mockery/mockery": "0.9.*", "orchestra/testbench": "3.4.*", - "phpunit/phpunit": "~5.7", - "fzaninotto/faker": "1.6.*" + "phpunit/phpunit": "~5.7" }, "autoload": { "psr-4": { @@ -45,7 +36,15 @@ }, "extra": { "branch-alias": { - "dev-master": "0.2.x-dev" + "dev-master": "0.3.x-dev" + }, + "laravel": { + "providers": [ + "FindBrok\\TradeoffAnalytics\\TradeoffAnalyticsServiceProvider" + ], + "aliases": { + "TradeoffAnalytics": "FindBrok\\TradeoffAnalytics\\Facades\\TradeoffAnalytics" + } } }, "minimum-stability": "dev",