app/Handlers/Duty/DutyGroups.php 1 location
|
@@ 57-65 (lines=9) @@
|
54 |
|
return $this->list; |
55 |
|
} |
56 |
|
|
57 |
|
public function recordNextEntry() |
58 |
|
{ |
59 |
|
if ($this->list->count() < 2) { |
60 |
|
return; |
61 |
|
} |
62 |
|
|
63 |
|
$nextGroupID = $this->list->toArray()[1]['id']; |
64 |
|
$this->duty->groups()->updateExistingPivot($nextGroupID, ['last_worked' => Carbon::today()]); |
65 |
|
} |
66 |
|
|
67 |
|
public function getLastWorked() |
68 |
|
{ |
app/Handlers/Duty/DutyUsers.php 1 location
|
@@ 75-83 (lines=9) @@
|
72 |
|
/** |
73 |
|
* Grab the next user to work the duty roster and record them in our database so they are the current worker. |
74 |
|
*/ |
75 |
|
public function recordNextEntry() |
76 |
|
{ |
77 |
|
if ($this->list->count() < 2) { |
78 |
|
return; |
79 |
|
} |
80 |
|
|
81 |
|
$nextUser = $this->list->toArray()[1]['user']; |
82 |
|
$this->duty->users()->updateExistingPivot($nextUser->id, ['last_worked' => Carbon::today()]); |
83 |
|
} |
84 |
|
|
85 |
|
/** |
86 |
|
* Get the current user in our database who is working the duty roster. |