laravel validate form data unique array 1

laravel validate form data unique array

'username' => ['required', Rule::unique('users', 'username')],

Here is what the above code is Doing:
1. We’re using the unique rule to check if the username is unique in the users table.
2. We’re passing the name of the table as the first argument to the unique rule.
3. We’re passing the name of the column as the second argument to the unique rule.

Similar Posts