I want to validate a value that I got from a certain form. The value type is text. I want it to match a specific username from the database from the users
table, but also to not match the current user's username.
To achieve that, I used the following validation rules:
'username' => [
'required',
'string',
'exists:App\User,username',
'different:' . auth()->user()->username
]
What I've discovered is that whenever the auth()->user()->username
value includes a digit, it passes the validation even if request()->username = auth()->user()->username
. Is there anything I can do to prevent this from happening?
Thanks in advance.