PasswordResetServiceProvider.php 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace Illuminate\Auth\Passwords;
  3. use Illuminate\Support\ServiceProvider;
  4. class PasswordResetServiceProvider 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->registerPasswordBroker();
  20. }
  21. /**
  22. * Register the password broker instance.
  23. *
  24. * @return void
  25. */
  26. protected function registerPasswordBroker()
  27. {
  28. $this->app->singleton('auth.password', function ($app) {
  29. return new PasswordBrokerManager($app);
  30. });
  31. $this->app->bind('auth.password.broker', function ($app) {
  32. return $app->make('auth.password')->broker();
  33. });
  34. }
  35. /**
  36. * Get the services provided by the provider.
  37. *
  38. * @return array
  39. */
  40. public function provides()
  41. {
  42. return ['auth.password', 'auth.password.broker'];
  43. }
  44. }