| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public function fire() |
||
| 38 | { |
||
| 39 | $key = $this->getRandomKey(); |
||
| 40 | if ($this->option('show')) { |
||
| 41 | return $this->line('<comment>'.$key.'</comment>'); |
||
| 42 | } |
||
| 43 | $path = base_path('.env'); |
||
| 44 | if (file_exists($path)) { |
||
| 45 | file_put_contents( |
||
| 46 | $path, |
||
| 47 | str_replace( |
||
| 48 | 'APP_KEY='.env('APP_KEY'), |
||
| 49 | 'APP_KEY='.$key, |
||
| 50 | file_get_contents($path)) |
||
| 51 | ); |
||
| 52 | } |
||
| 53 | $this->info("Application key [$key] set successfully."); |
||
| 54 | } |
||
| 55 | |||
| 78 |