Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public function created(Task $task) |
||
21 | { |
||
22 | if (Auth::check()) { |
||
23 | $username = Auth::user()->name; |
||
|
|||
24 | } else { |
||
25 | $username = User::findOrFail($task->user_id)->name; |
||
26 | } |
||
27 | TaskEvent::create([ |
||
28 | 'time' => Carbon::now(), |
||
29 | 'task_name' => $task->name, |
||
30 | 'user_name' => $username, |
||
31 | 'type' => 'created', |
||
32 | ]); |
||
80 |