File tree 2 files changed +52
-0
lines changed
2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace BotMan \Studio \Console \Commands ;
4
+
5
+ use Illuminate \Filesystem \Filesystem ;
6
+ use Illuminate \Console \GeneratorCommand ;
7
+
8
+ class BotManCacheClear extends GeneratorCommand
9
+ {
10
+ /**
11
+ * The name and signature of the console command.
12
+ *
13
+ * @var string
14
+ */
15
+ protected $ signature = 'botman:cache:clear ' ;
16
+
17
+ /**
18
+ * The console command description.
19
+ *
20
+ * @var string
21
+ */
22
+ protected $ description = 'Remove all cached conversations. ' ;
23
+
24
+ /**
25
+ * Create a new command instance.
26
+ *
27
+ * @return void
28
+ */
29
+ public function __construct ()
30
+ {
31
+ parent ::__construct ();
32
+ }
33
+
34
+ /**
35
+ * Execute the console command.
36
+ *
37
+ * @param \Illuminate\Filesystem\Filesystem $files
38
+ * @return mixed
39
+ */
40
+ public function handle (Filesystem $ files )
41
+ {
42
+ $ cacheFolder = storage_path ('botman ' );
43
+
44
+ if ($ files ->exists ($ cacheFolder )) {
45
+ $ files ->cleanDirectory ($ cacheFolder );
46
+ }
47
+
48
+ $ this ->info ('BotMan cache cleared! ' );
49
+ }
50
+ }
Original file line number Diff line number Diff line change 5
5
use Illuminate \Support \ServiceProvider ;
6
6
use TheCodingMachine \Discovery \Discovery ;
7
7
use BotMan \Studio \Console \Commands \BotManMakeTest ;
8
+ use BotMan \Studio \Console \Commands \BotManCacheClear ;
8
9
use BotMan \Studio \Console \Commands \BotManListDrivers ;
9
10
use BotMan \Studio \Console \Commands \BotManInstallDriver ;
10
11
use BotMan \Studio \Console \Commands \BotManMakeMiddleware ;
@@ -23,6 +24,7 @@ public function register()
23
24
BotManMakeMiddleware::class,
24
25
BotManMakeConversation::class,
25
26
BotManMakeTest::class,
27
+ BotManCacheClear::class,
26
28
]);
27
29
28
30
$ this ->discoverCommands ();
You can’t perform that action at this time.
0 commit comments