| Total Complexity | 5 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace GeneaLabs\LaravelModelCaching\Console\Commands; |
||
| 5 | class Flush extends Command |
||
| 6 | { |
||
| 7 | protected $signature = 'modelCache:flush {--model=}'; |
||
| 8 | protected $description = 'Flush cache for a given model. If no model is given, entire model-cache is flushed.'; |
||
| 9 | |||
| 10 | public function handle() |
||
| 11 | { |
||
| 12 | $option = $this->option('model'); |
||
| 13 | |||
| 14 | if (! $option) { |
||
| 15 | return $this->flushEntireCache(); |
||
| 16 | } |
||
| 17 | |||
| 18 | return $this->flushModelCache($option); |
||
| 19 | } |
||
| 20 | |||
| 21 | protected function flushEntireCache() : int |
||
| 30 | } |
||
| 31 | |||
| 32 | protected function flushModelCache(string $option) : int |
||
| 49 | } |
||
| 50 | } |
||
| 51 |