HashServiceProvider.php 791B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace Illuminate\Hashing;
  3. use Illuminate\Support\ServiceProvider;
  4. class HashServiceProvider extends ServiceProvider
  5. {
  6. /**
  7. * Indicates if loading of the provider is deferred.
  8. *
  9. * @var bool
  10. */
  11. protected $defer = true;
  12. /**
  13. * Register the service provider.
  14. *
  15. * @return void
  16. */
  17. public function register()
  18. {
  19. $this->app->singleton('hash', function ($app) {
  20. return new HashManager($app);
  21. });
  22. $this->app->singleton('hash.driver', function ($app) {
  23. return $app['hash']->driver();
  24. });
  25. }
  26. /**
  27. * Get the services provided by the provider.
  28. *
  29. * @return array
  30. */
  31. public function provides()
  32. {
  33. return ['hash', 'hash.driver'];
  34. }
  35. }