How to Check if a Value is Not Equal to a another Field in Laravel Validation
In this lesson, we will see how to check if a value is not equal to another field in Laravel validation, sometimes when working on a Laravel project you want a field to be different from another using validation, so let's see how we can do that.
Use laravel different validation rule
So to do that we use Laravel different validation rule here is an example:
return [
'first_name' => 'required|different:last_name',
'last_name' => 'required|different:first_name',
];