Conditions | 4 |
Paths | 8 |
Total Lines | 21 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
37 | public function handle() |
||
38 | { |
||
39 | $id = $this->argument('id') ? $this->argument('id') : $this->askForTasks(); |
||
40 | $task = Task::findOrFail($id); |
||
41 | $user = User::findOrFail($task->user_id); |
||
42 | |||
43 | $this->info('Task:'); |
||
44 | |||
45 | try { |
||
46 | $headers = ['Key', 'Value']; |
||
47 | |||
48 | $fields = [ |
||
49 | ['Name:', $task->name], |
||
50 | ['Completed:', $task->completed?'Yes':'No',], |
||
51 | ['User id:', $task->user_id], |
||
52 | ['User name:', $user->name], |
||
|
|||
53 | ]; |
||
54 | |||
55 | $this->table($headers, $fields); |
||
56 | } catch (Exception $e) { |
||
57 | $this->error('Error'); |
||
58 | } |
||
61 |