File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ class PurgeCommand extends Command
15
15
*/
16
16
protected $ signature = 'passport:purge
17
17
{--revoked : Only purge revoked tokens and authentication codes}
18
- {--expired : Only purge expired tokens and authentication codes} ' ;
18
+ {--expired : Only purge expired tokens and authentication codes}
19
+ {--hours= : The number of hours to retain expired tokens} ' ;
19
20
20
21
/**
21
22
* The console command description.
@@ -29,7 +30,9 @@ class PurgeCommand extends Command
29
30
*/
30
31
public function handle ()
31
32
{
32
- $ expired = Carbon::now ()->subDays (7 );
33
+ $ expired = $ this ->option ('hours ' )
34
+ ? Carbon::now ()->subHours ($ this ->option ('hours ' ))
35
+ : Carbon::now ()->subDays (7 );
33
36
34
37
if (($ this ->option ('revoked ' ) && $ this ->option ('expired ' )) ||
35
38
(! $ this ->option ('revoked ' ) && ! $ this ->option ('expired ' ))) {
You can’t perform that action at this time.
0 commit comments