*/ protected $hidden = [ 'password', 'remember_token', ]; /** * Map attribute names to enum classes. * * @var array */ protected $enumCasts = [ 'role' => UserRoleEnum::class ]; /** * Perform any actions required after the model boots. * * @return void */ protected static function booted() { // * EVENT CLOSURES. static::creating(function (User $user) { if (Hash::needsRehash($user->password)) { $user->password = Hash::make($user->password); } }); static::updating(function (User $user) { if (Hash::needsRehash($user->password)) { $user->password = Hash::make($user->password); } }); } /** * Send a password reset notification to the user. * * @param string $token * @return void * @phpcs:disable Squiz.Commenting.FunctionComment.ScalarTypeHintMissing */ public function sendPasswordResetNotification($token) { // phpcs:enable $notification = new ResetPasswordNotification($token); // * Changed route here only $notification->createUrlUsing(function ($notifiable, $token) { return url(route('bo.password.reset', [ 'token' => $token, 'email' => $notifiable->getEmailForPasswordReset(), ], false)); }); $this->notify($notification); } }