File tree Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -21,16 +21,6 @@ class DataTablesPurgeExportCommand extends Command
21
21
*/
22
22
protected $ description = 'Remove exported files that datatables-export generate. ' ;
23
23
24
- /**
25
- * Create a new command instance.
26
- *
27
- * @return void
28
- */
29
- public function __construct ()
30
- {
31
- parent ::__construct ();
32
- }
33
-
34
24
/**
35
25
* Execute the console command.
36
26
*
@@ -40,7 +30,9 @@ public function handle()
40
30
{
41
31
collect (Storage::listContents ('exports ' ))
42
32
->each (function ($ file ) {
43
- Storage::delete ($ file ['path ' ]);
33
+ if ($ file ['timestamp ' ] < now ()->subDay (1 )->getTimestamp ()) {
34
+ Storage::delete ($ file ['path ' ]);
35
+ }
44
36
});
45
37
46
38
$ this ->info ('The command was successful. Export files are cleared! ' );
Original file line number Diff line number Diff line change @@ -50,10 +50,6 @@ public function register()
50
50
{
51
51
$ this ->mergeConfigFrom (__DIR__ . '/config/datatables-export.php ' , 'datatables-export ' );
52
52
53
- $ this ->commands (
54
- [
55
- DataTablesPurgeExportCommand::class,
56
- ]
57
- );
53
+ $ this ->commands ([ataTablesPurgeExportCommand::class]);
58
54
}
59
55
}
You can’t perform that action at this time.
0 commit comments