Skip to content

Commit 9b46485

Browse files
committed
allow injecting default hasher with contract
1 parent f3e1895 commit 9b46485

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/Illuminate/Foundation/Application.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,7 @@ public function registerCoreContainerAliases()
11381138
'filesystem.disk' => [\Illuminate\Contracts\Filesystem\Filesystem::class],
11391139
'filesystem.cloud' => [\Illuminate\Contracts\Filesystem\Cloud::class],
11401140
'hash' => [\Illuminate\Hashing\HashManager::class],
1141+
'hash.driver' => [\Illuminate\Contracts\Hashing\Hasher::class],
11411142
'translator' => [\Illuminate\Translation\Translator::class, \Illuminate\Contracts\Translation\Translator::class],
11421143
'log' => [\Illuminate\Log\LogManager::class, \Psr\Log\LoggerInterface::class],
11431144
'mailer' => [\Illuminate\Mail\Mailer::class, \Illuminate\Contracts\Mail\Mailer::class, \Illuminate\Contracts\Mail\MailQueue::class],

src/Illuminate/Hashing/HashServiceProvider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ public function register()
2323
$this->app->singleton('hash', function ($app) {
2424
return new HashManager($app);
2525
});
26+
27+
$this->app->singleton('hash.driver', function ($app) {
28+
return $app['hash']->driver();
29+
});
2630
}
2731

2832
/**

0 commit comments

Comments
 (0)