| Conditions | 4 |
| Paths | 8 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 36 | public function handle() |
||
| 37 | { |
||
| 38 | try { |
||
| 39 | $id = $this->argument('id') ? $this->argument('id') : $this->askForTasks(); |
||
| 40 | $task = Task::findOrFail($id); |
||
| 41 | $task->update([ |
||
| 42 | 'completed' => $task->completed ? false : true, |
||
| 43 | ]); |
||
| 44 | } catch (Exception $e) { |
||
| 45 | $this->error('Error'); |
||
| 46 | } |
||
| 47 | $this->info('Task status has been edited to database succesfully'); |
||
| 48 | } |
||
| 50 |