Changeset View
Changeset View
Standalone View
Standalone View
src/app/Observers/UserObserver.php
Show All 26 Lines | public function creating(User $user) | ||||
$allegedly_unique = \App\Utils::uuidInt(); | $allegedly_unique = \App\Utils::uuidInt(); | ||||
if (!User::find($allegedly_unique)) { | if (!User::find($allegedly_unique)) { | ||||
$user->{$user->getKeyName()} = $allegedly_unique; | $user->{$user->getKeyName()} = $allegedly_unique; | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
$user->email = \strtolower($user->email); | |||||
// only users that are not imported get the benefit of the doubt. | // only users that are not imported get the benefit of the doubt. | ||||
$user->status |= User::STATUS_NEW | User::STATUS_ACTIVE; | $user->status |= User::STATUS_NEW | User::STATUS_ACTIVE; | ||||
// can't dispatch job here because it'll fail serialization | // can't dispatch job here because it'll fail serialization | ||||
} | } | ||||
/** | /** | ||||
* Handle the "created" event. | * Handle the "created" event. | ||||
▲ Show 20 Lines • Show All 217 Lines • Show Last 20 Lines |