© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
7 replies
Adnan Yalahow

Prevent old password as new password

I need help to tp prevent user entering the same old password as new password
Solution
or

TextInput::make('password')->rules([
    fn (): Closure => function (string $attribute, $value, Closure $fail) {
        if (Hash::check($value, $this->user->password)) {
            $fail('The new password must be different from your current password.');
        }
    },
])
TextInput::make('password')->rules([
    fn (): Closure => function (string $attribute, $value, Closure $fail) {
        if (Hash::check($value, $this->user->password)) {
            $fail('The new password must be different from your current password.');
        }
    },
])
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Prevent Logout when changing Admin Password?
FilamentFFilament / ❓┊help
3y ago
Prevent Logout when changing Admin Password
FilamentFFilament / ❓┊help
3y ago
Stop New Password field auto-filling
FilamentFFilament / ❓┊help
3y ago
Old status update To New status
FilamentFFilament / ❓┊help
2y ago