File tree Expand file tree Collapse file tree 5 files changed +51
-2
lines changed Expand file tree Collapse file tree 5 files changed +51
-2
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace App \Console \Commands ;
4
+
5
+ use Illuminate \Console \Command ;
6
+ use Illuminate \Support \Facades \File ;
7
+
8
+ class CleanTemp extends Command
9
+ {
10
+ /**
11
+ * The name and signature of the console command.
12
+ *
13
+ * @var string
14
+ */
15
+ protected $ signature = 'simpede:clean-temp ' ;
16
+
17
+ /**
18
+ * The console command description.
19
+ *
20
+ * @var string
21
+ */
22
+ protected $ description = 'Clean temporary files ' ;
23
+
24
+ /**
25
+ * Execute the console command.
26
+ */
27
+ public function handle ()
28
+ {
29
+
30
+ $ folderPath = storage_path ('app/filepond/temp ' );
31
+
32
+ // Hapus semua isi folder (file dan subfolder)
33
+ File::deleteDirectory ($ folderPath );
34
+
35
+ $ this ->info ("Temporary files in ' {$ folderPath }' cleaned successfully. " );
36
+ }
37
+ }
Original file line number Diff line number Diff line change @@ -29,5 +29,7 @@ public function handle()
29
29
DB ::table ('action_events ' )
30
30
->where ('status ' , 'finished ' )
31
31
->delete ();
32
+
33
+ $ this ->info ('Finished action events logs cleared successfully. ' );
32
34
}
33
35
}
Original file line number Diff line number Diff line change @@ -31,5 +31,7 @@ public function handle()
31
31
foreach ($ reminders as $ reminder ) {
32
32
Helper::sendReminder ($ reminder );
33
33
}
34
+
35
+ $ this ->info ('Scheduled reminders sent successfully. ' );
34
36
}
35
37
}
Original file line number Diff line number Diff line change @@ -28,14 +28,20 @@ public function handle()
28
28
{
29
29
$ action = $ this ->argument ('action ' );
30
30
31
+ $ backupDisks = config ('backup.backup.destination.disks ' , []);
32
+
31
33
if ($ action === 'create ' ) {
32
34
$ this ->call ('action-events:clear ' );
33
35
$ this ->call ('backup:run ' );
34
36
$ this ->call ('backup:clean ' );
35
- Storage::disk ('google ' )->getAdapter ()->emptyTrash ([]);
37
+ foreach ($ backupDisks as $ disk ) {
38
+ Storage::disk ($ disk )->getAdapter ()->emptyTrash ([]);
39
+ }
36
40
} elseif ($ action === 'clean ' ) {
37
41
$ this ->call ('backup:clean ' );
38
- Storage::disk ('google ' )->getAdapter ()->emptyTrash ([]);
42
+ foreach ($ backupDisks as $ disk ) {
43
+ Storage::disk ($ disk )->getAdapter ()->emptyTrash ([]);
44
+ }
39
45
} else {
40
46
$ this ->error ('Invalid action. Use "create" or "clean". ' );
41
47
}
Original file line number Diff line number Diff line change @@ -85,5 +85,7 @@ public function handle()
85
85
User::cache ()->updateAll ();
86
86
UserEksternal::cache ()->updateAll ();
87
87
WhatsappGroup::cache ()->updateAll ();
88
+
89
+ $ this ->info ('All cache updated successfully. ' );
88
90
}
89
91
}
You can’t perform that action at this time.
0 commit comments