mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-12 03:13:45 +02:00
Fix some missing exceptions and validation handling for users
This commit is contained in:
@@ -80,11 +80,17 @@ class UserRepository
|
||||
'totp_secret' => 'size:16'
|
||||
]);
|
||||
|
||||
// Run validator, throw catchable and displayable exception if it fails.
|
||||
// Exception includes a JSON result of failed validation rules.
|
||||
if ($validator->fails()) {
|
||||
throw new DisplayValidationException($validator->errors());
|
||||
}
|
||||
|
||||
if(array_key_exists('password', $data)) {
|
||||
$user['password'] = Hash::make($data['password']);
|
||||
}
|
||||
|
||||
return Models\User::find($id)->update($data);
|
||||
return Models\User::findOrFail($id)->update($data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user