From e9612d4a784fcbd81c7b53cff2a63ba9b99f3165 Mon Sep 17 00:00:00 2001 From: Sam Millar Date: Wed, 14 Oct 2015 10:51:35 +0100 Subject: [PATCH] Allow optional custom salt Because I'm using this package in conjunction with the JS version, on the client side, I need to have matching salts but don't wish to expose my app's secret key to the world. This will now look for a package config specific salt before falling back to the app key. Also mentioned in #21. --- src/Mitch/Hashids/HashidsServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mitch/Hashids/HashidsServiceProvider.php b/src/Mitch/Hashids/HashidsServiceProvider.php index 0e5adf8..e33eb90 100644 --- a/src/Mitch/Hashids/HashidsServiceProvider.php +++ b/src/Mitch/Hashids/HashidsServiceProvider.php @@ -30,7 +30,7 @@ protected function registerHashids() { $this->app->bind('Hashids\Hashids', function ($app) { return new Hashids( - $app['config']['app.key'], + isset($app['config']['hashids::salt']) ? $app['config']['hashids::salt'] : $app['config']['app.key'], $app['config']['hashids::length'], $app['config']['hashids::alphabet'] );