Go nuclear on Safari's autocomplete.

This commit is contained in:
Dane Everitt 2017-05-01 16:41:39 -04:00
parent b539f26dab
commit c9c0e845b1
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
7 changed files with 23 additions and 38 deletions

View file

@ -141,20 +141,12 @@ class UserController extends Controller
*/
public function update(Request $request, $id)
{
// Rename variables because autofill cannot be disabled
// in any logical manner, and editing users is impossible.
$fixedData = array_filter(
collect($request->all())->mapWithKeys(function ($item, $key) {
return [str_replace('input_', '', $key) => $item];
})->only([
'email', 'password', 'name_first',
'name_last', 'username', 'root_admin',
])->toArray()
);
try {
$repo = new UserRepository;
$user = $repo->update($id, $fixedData);
$user = $repo->update($id, $request->intersect([
'email', 'password', 'name_first',
'name_last', 'username', 'root_admin',
]));
Alert::success('User account was successfully updated.')->flash();
} catch (DisplayValidationException $ex) {
return redirect()->route('admin.users.view', $id)->withErrors(json_decode($ex->getMessage()));