Skip to content

Commit

Permalink
Second try on manager.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Lundbøl committed Nov 4, 2017
1 parent b7ddd6c commit c272b15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/Illuminate/Foundation/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ function base_path($path = '')
*/
function bcrypt($value, $options = [])
{
return app('hash.bcrypt')
return app('hash')
->driver('bcrypt')
->make($value, $options);
}
}
Expand Down
12 changes: 2 additions & 10 deletions src/Illuminate/Hashing/HashServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,8 @@ class HashServiceProvider extends ServiceProvider
*/
public function register()
{
$this->app->singleton('hash.manager', function ($app) {
return (new HashManager($app));
});

$this->app->singleton('hash', function ($app) {
return $app['hash.manager']->driver();
});

$this->app->singleton('hash.bcrypt', function($app) {
return $app['hash.manager']->driver('bcrypt');
return new HashManager($app);
});
}

Expand All @@ -40,6 +32,6 @@ public function register()
*/
public function provides()
{
return ['hash', 'hash.manager', 'hash.bcrypt'];
return ['hash'];
}
}

0 comments on commit c272b15

Please sign in to comment.