Prevent old password as new password
I need help to tp prevent user entering the same old password as new password
Solution:Jump to solution
or
```php
TextInput::make('password')->rules([
fn (): Closure => function (string $attribute, $value, Closure $fail) {...
5 Replies
use a custom rule?
I am using custom edit profile so how do i use it
see:https://filamentphp.com/docs/3.x/forms/validation
Create the above NotSamePassword in App\Rules and then call that rule class in the
https://filamentphp.com/docs/3.x/forms/validation#custom-rules
->rules([new NotSamePassword()])
Solution
or
Thank you so much. i want to add that $this->user->password didn't work so i used auth()->user()->getAuthPassword()