From 860a12ecdc0efb1a204c0a5d749c61d5a345db46 Mon Sep 17 00:00:00 2001 From: Randy Booth Date: Wed, 28 Jan 2015 23:32:53 -0600 Subject: [PATCH 1/4] Update composer to laravel 5.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b0b6969..14d85e3 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ ], "require": { "php": ">=5.3.0", - "illuminate/support": "4.x", + "illuminate/support": "5.0.*", "hashids/hashids": "1.0.x" }, "autoload": { From 8ae2d1860167093c1b68e9fb33fa14722a92548a Mon Sep 17 00:00:00 2001 From: Randy Booth Date: Wed, 28 Jan 2015 23:54:54 -0600 Subject: [PATCH 2/4] Lavavel 5 config --- src/Mitch/Hashids/HashidsServiceProvider.php | 4 +++- src/config/{config.php => hashids.php} | 0 2 files changed, 3 insertions(+), 1 deletion(-) rename src/config/{config.php => hashids.php} (100%) diff --git a/src/Mitch/Hashids/HashidsServiceProvider.php b/src/Mitch/Hashids/HashidsServiceProvider.php index 0e5adf8..19a3060 100644 --- a/src/Mitch/Hashids/HashidsServiceProvider.php +++ b/src/Mitch/Hashids/HashidsServiceProvider.php @@ -12,7 +12,9 @@ class HashidsServiceProvider extends ServiceProvider */ public function boot() { - $this->package('mitch/hashids'); + $configPath = __DIR__ . '/../../config/hashids.php'; + $this->mergeConfigFrom($configPath, 'hashids'); + $this->publishes([$configPath => config_path('hashids.php')]); } /** diff --git a/src/config/config.php b/src/config/hashids.php similarity index 100% rename from src/config/config.php rename to src/config/hashids.php From 9591f9d7783f8110977bd4ae32647b44a2c0cccf Mon Sep 17 00:00:00 2001 From: Randy Booth Date: Thu, 29 Jan 2015 00:06:36 -0600 Subject: [PATCH 3/4] Change config :: to . --- src/Mitch/Hashids/HashidsServiceProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mitch/Hashids/HashidsServiceProvider.php b/src/Mitch/Hashids/HashidsServiceProvider.php index 19a3060..638d033 100644 --- a/src/Mitch/Hashids/HashidsServiceProvider.php +++ b/src/Mitch/Hashids/HashidsServiceProvider.php @@ -33,8 +33,8 @@ protected function registerHashids() $this->app->bind('Hashids\Hashids', function ($app) { return new Hashids( $app['config']['app.key'], - $app['config']['hashids::length'], - $app['config']['hashids::alphabet'] + $app['config']['hashids.length'], + $app['config']['hashids.alphabet'] ); }); } From 3d0e1e67484048648be388f6f7bc3fbc99ba5178 Mon Sep 17 00:00:00 2001 From: Randy Booth Date: Thu, 29 Jan 2015 07:30:52 -0600 Subject: [PATCH 4/4] Change to use config() --- src/Mitch/Hashids/HashidsServiceProvider.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Mitch/Hashids/HashidsServiceProvider.php b/src/Mitch/Hashids/HashidsServiceProvider.php index 638d033..386d051 100644 --- a/src/Mitch/Hashids/HashidsServiceProvider.php +++ b/src/Mitch/Hashids/HashidsServiceProvider.php @@ -30,11 +30,11 @@ public function register() protected function registerHashids() { - $this->app->bind('Hashids\Hashids', function ($app) { + $this->app->bind('Hashids\Hashids', function () { return new Hashids( - $app['config']['app.key'], - $app['config']['hashids.length'], - $app['config']['hashids.alphabet'] + config('app.key'), + config('hashids.length'), + config('hashids.alphabet') ); }); }