| Conditions | 2 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | public function handle() |
||
| 12 | { |
||
| 13 | $artisanCommand = substr($this->request->text, 8); |
||
| 14 | |||
| 15 | try { |
||
| 16 | Artisan::call($artisanCommand, []); |
||
| 17 | |||
| 18 | $this->respondToSlack(Artisan::output())->send(); |
||
| 19 | } catch (CommandNotFoundException $exception) { |
||
| 20 | $this->respondToSlack("Whoops... something went wrong!") |
||
| 21 | ->withAttachment(Attachment::create() |
||
| 22 | ->setColor('danger') |
||
| 23 | ->setText("The Artisan command `{$artisanCommand}` does not exist.") |
||
| 24 | ) |
||
| 25 | ->send(); |
||
| 26 | |||
| 27 | } |
||
| 28 | |||
| 29 | |||
| 30 | } |
||
| 31 | } |