Update user account change function logical order

This commit is contained in:
DariusIII
2018-06-20 12:58:54 +02:00
parent 98ae158e0f
commit caf4b09fc3
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -1,4 +1,5 @@
2018-06-20 DariusIII
* Chg: Update user account change function logical order
* Chg: Add function to delete users that have not verified their accounts for 3 or more days
* Chg: Update users migration and add patch for existing users table
* Chg: Update routes, fix user verification
+1 -1
View File
@@ -445,8 +445,8 @@ class User extends Authenticatable
$data = self::query()->whereDate('rolechangedate', '<', now())->get();
foreach ($data as $u) {
Mail::to($u['email'])->send(new AccountChange($u['id']));
self::query()->where('id', $u['id'])->update(['user_roles_id' => self::ROLE_USER, 'rolechangedate' => null]);
Mail::to($u['email'])->send(new AccountChange($u['id']));
}
return self::SUCCESS;