Allowance check
This commit is contained in:
@@ -41,7 +41,24 @@ class UpdateController extends Controller
|
||||
|
||||
private function updateVoter($request, $id)
|
||||
{
|
||||
$voter = $request->all();
|
||||
Voter::find($id)->update($voter);
|
||||
$voter = Voter::findOrFail($id);
|
||||
|
||||
$old = $voter->toArray();
|
||||
$voter->fill($request->all());
|
||||
$voter->save();
|
||||
|
||||
$dirtyKeys = array_keys($voter->getChanges());
|
||||
|
||||
activity()
|
||||
->performedOn($voter)
|
||||
->withProperties([
|
||||
'voter_id' => $voter->id,
|
||||
'voter_name' => $voter->name,
|
||||
'election_id' => Util::getCurrentElection(),
|
||||
'changed_keys' => $dirtyKeys,
|
||||
'ip' => $request->ip(),
|
||||
'user_agent' => $request->userAgent(),
|
||||
])
|
||||
->log("update voter: {$voter->name}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user