Conditions | 4 |
Paths | 16 |
Total Lines | 21 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public function handle() |
||
31 | { |
||
32 | $key = $this->option('key') ?: 'primary'; |
||
33 | $this->info("Trying to renew your {$key} key..."); |
||
34 | |||
35 | try { |
||
36 | $apiKey = app()->make(ApiKey::class); |
||
37 | |||
38 | if ($this->option('key') === 'secondary') { |
||
39 | $apiKey->renewSecondary(config('signere.secondary_key')); |
||
40 | } else { |
||
41 | $apiKey->renewPrimary(config('signere.primary_key')); |
||
42 | } |
||
43 | |||
44 | $this->info("Your {$key} key was renewed!"); |
||
45 | } catch (Exception $e) { |
||
46 | $this->error("Renewing failed because: {$e->getMessage()}."); |
||
47 | |||
48 | return -1; |
||
49 | } |
||
50 | } |
||
51 | } |
||
52 |