Conditions | 4 |
Paths | 3 |
Total Lines | 23 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public function handle() |
||
18 | { |
||
19 | $snapShots = app(SnapshotRepository::class)->getAll(); |
||
|
|||
20 | |||
21 | if (app(SnapshotRepository::class)->getAll()->isEmpty()) { |
||
22 | $this->warn('No snapshots found. Run `snapshot:create` to create snapshots.'); |
||
23 | |||
24 | return; |
||
25 | } |
||
26 | |||
27 | $name = $this->argument('name') ?: $this->askForSnapshotName(); |
||
28 | |||
29 | $snapshot = app(SnapshotRepository::class)->findByName($name); |
||
30 | |||
31 | if (! $snapshot) { |
||
32 | $this->warn("Snapshot `{$name}` does not exist!"); |
||
33 | |||
34 | return; |
||
35 | } |
||
36 | |||
37 | $snapshot->delete(); |
||
38 | |||
39 | $this->info("Snapshot `{$snapshot->name}` deleted!"); |
||
40 | } |
||
42 |