Closed blorange2 closed 4 years ago
Try something similar to this:
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'current-password' => 'required|string',
'new-password' => array_merge(
[
'regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{6,}$/',
],
PasswordRules::changePassword(auth()->user()->email, $this->get('current-password')),
),
];
}
I never considered using auth()->user()
, I'll try now.
That works (y)
In my application I have an area where user's can update their password by providing:
I have a method that looks like this:
This uses a Form Request called
UpdatePassword
.I've tried to simply pass in the email and pass, but they're not real properties.
Is there any way to do what I'm attempting in this way?