Skip to content

Commit

Permalink
allow injecting default hasher with contract
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Feb 1, 2018
1 parent f3e1895 commit 9b46485
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
4 changes: 4 additions & 0 deletions src/Illuminate/Hashing/HashServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}

/**
Expand Down

0 comments on commit 9b46485

Please sign in to comment.