Completed
Push — master ( edb43e...425779 )
by Abdelrahman
10:35
created

ClearResetsCommand   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A fire() 0 6 1
1
<?php
2
3
/*
4
 * NOTICE OF LICENSE
5
 *
6
 * Part of the Rinvex Fort Package.
7
 *
8
 * This source file is subject to The MIT License (MIT)
9
 * that is bundled with this package in the LICENSE file.
10
 *
11
 * Package: Rinvex Fort Package
12
 * License: The MIT License (MIT)
13
 * Link:    https://rinvex.com
14
 */
15
16
declare(strict_types=1);
17
18
namespace Rinvex\Fort\Console\Commands;
19
20
use Illuminate\Console\Command;
21
22
class ClearResetsCommand extends Command
23
{
24
    /**
25
     * The name and signature of the console command.
26
     *
27
     * @var string
28
     */
29
    protected $signature = 'auth:clear-resets {name? : The name of the password broker}';
30
31
    /**
32
     * The console command description.
33
     *
34
     * @var string
35
     */
36
    protected $description = 'Flush expired password reset tokens';
37
38
    /**
39
     * Execute the console command.
40
     *
41
     * @return void
42
     */
43
    public function fire()
44
    {
45
        $this->laravel['auth.password']->broker($this->argument('name'))->getRepository()->deleteExpired();
46
47
        $this->info('Expired reset tokens cleared!');
48
    }
49
}
50