From 9b4648523debeb6c8ef70811d778b9be64312bd3 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 1 Feb 2018 08:41:03 -0600 Subject: [PATCH] allow injecting default hasher with contract --- src/Illuminate/Foundation/Application.php | 1 + src/Illuminate/Hashing/HashServiceProvider.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index 0dd4dbd05ff0..db686070010d 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -1138,6 +1138,7 @@ public function registerCoreContainerAliases() 'filesystem.disk' => [\Illuminate\Contracts\Filesystem\Filesystem::class], 'filesystem.cloud' => [\Illuminate\Contracts\Filesystem\Cloud::class], 'hash' => [\Illuminate\Hashing\HashManager::class], + 'hash.driver' => [\Illuminate\Contracts\Hashing\Hasher::class], 'translator' => [\Illuminate\Translation\Translator::class, \Illuminate\Contracts\Translation\Translator::class], 'log' => [\Illuminate\Log\LogManager::class, \Psr\Log\LoggerInterface::class], 'mailer' => [\Illuminate\Mail\Mailer::class, \Illuminate\Contracts\Mail\Mailer::class, \Illuminate\Contracts\Mail\MailQueue::class], diff --git a/src/Illuminate/Hashing/HashServiceProvider.php b/src/Illuminate/Hashing/HashServiceProvider.php index 5b8d525463d9..103021808387 100755 --- a/src/Illuminate/Hashing/HashServiceProvider.php +++ b/src/Illuminate/Hashing/HashServiceProvider.php @@ -23,6 +23,10 @@ public function register() $this->app->singleton('hash', function ($app) { return new HashManager($app); }); + + $this->app->singleton('hash.driver', function ($app) { + return $app['hash']->driver(); + }); } /**