File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed
src/Illuminate/Cache/Console Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -50,24 +50,21 @@ public function __construct(CacheManager $cache)
5050 */
5151 public function handle ()
5252 {
53- $ storeName = $ this ->hasArgument ('store ' ) ? $ this ->argument ('store ' ) : null ;
54- $ tagsNames = $ this ->hasOption ('tags ' ) ? $ this ->option ('tags ' ) : null ;
53+ $ tags = (array ) explode (', ' , $ this ->option ('tags ' ));
5554
56- $ store = $ this ->cache ->store ($ storeName );
55+ $ cache = $ this ->cache ->store ($ store = $ this -> argument ( ' store ' ) );
5756
58- $ this ->laravel ['events ' ]->fire ('cache:clearing ' , [$ storeName , $ tagsNames ]);
57+ $ this ->laravel ['events ' ]->fire ('cache:clearing ' , [$ store , $ tags ]);
5958
60- if (! is_null ($ tagsNames )) {
61- $ store ->tags (explode (', ' , $ tagsNames ))->flush ();
62-
63- $ this ->info (sprintf ('Application cache tags "%s" cleared! ' , $ tagsNames ));
59+ if (! empty ($ tags )) {
60+ $ cache ->tags ($ tags )->flush ();
6461 } else {
65- $ store ->flush ();
66-
67- $ this ->info ('Application cache cleared! ' );
62+ $ cache ->flush ();
6863 }
6964
70- $ this ->laravel ['events ' ]->fire ('cache:cleared ' , [$ storeName , $ tagsNames ]);
65+ $ this ->info ('Cache cleared successfully. ' );
66+
67+ $ this ->laravel ['events ' ]->fire ('cache:cleared ' , [$ store , $ tags ]);
7168 }
7269
7370 /**
You can’t perform that action at this time.
0 commit comments