#3611 igam notification

This commit is contained in:
Diatrex 2021-03-25 18:00:01 +03:00
parent 2267339c91
commit de79acb2dc
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,9 @@
<?php namespace Visiosoft\ProfileModule\Events;
class PasswordChanged
{
public function __construct()
{
}
}

View File

@ -5,6 +5,7 @@ use Anomaly\UsersModule\User\User;
use Anomaly\UsersModule\User\UserPassword;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Visiosoft\ProfileModule\Events\PasswordChanged;
class PasswordFormHandler
{
@ -43,6 +44,9 @@ class PasswordFormHandler
$user = User::query()->find(Auth::id());
$user->setAttribute('password', $builder->getPostValue('new_password'));
$user->save($user->toArray());
event(new PasswordChanged());
$messages->success(trans('visiosoft.module.profile::message.your_password_changed'));
}
}