mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-05-01 16:00:53 -05:00
(Update) Optimize Many Queries
- reduce load
This commit is contained in:
@@ -20,13 +20,13 @@ class ResetPasswordController extends Controller
|
||||
|
||||
protected function resetPassword($user, $password)
|
||||
{
|
||||
$validatingGroup = Group::where('slug', '=', 'validating')->first();
|
||||
$memberGroup = Group::where('slug', '=', 'member')->first();
|
||||
$validatingGroup = Group::where('slug', '=', 'validating')->pluck('id');
|
||||
$memberGroup = Group::where('slug', '=', 'member')->pluck('id');
|
||||
$user->password = bcrypt($password);
|
||||
$user->remember_token = Str::random(60);
|
||||
|
||||
if ($user->group_id === $validatingGroup->id) {
|
||||
$user->group_id = $memberGroup->id;
|
||||
if ($user->group_id === $validatingGroup) {
|
||||
$user->group_id = $memberGroup;
|
||||
}
|
||||
|
||||
$user->active = true;
|
||||
|
||||
Reference in New Issue
Block a user