ClearResetsCommand.php 742B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Illuminate\Auth\Console;
  3. use Illuminate\Console\Command;
  4. class ClearResetsCommand extends Command
  5. {
  6. /**
  7. * The name and signature of the console command.
  8. *
  9. * @var string
  10. */
  11. protected $signature = 'auth:clear-resets {name? : The name of the password broker}';
  12. /**
  13. * The console command description.
  14. *
  15. * @var string
  16. */
  17. protected $description = 'Flush expired password reset tokens';
  18. /**
  19. * Execute the console command.
  20. *
  21. * @return void
  22. */
  23. public function handle()
  24. {
  25. $this->laravel['auth.password']->broker($this->argument('name'))->getRepository()->deleteExpired();
  26. $this->info('Expired reset tokens cleared!');
  27. }
  28. }