Answers for "laravel validation unique if this field is changed"

PHP
1

laravel validation unique if this field is changed

use Illuminate\Validation\Rule;

$request->validate([
    'phone' => [
        'required',
        Rule::unique('table_name', 'column_name')->ignore($request->id),
    ],
]);
Posted by: Guest on September-30-2021

Code answers related to "laravel validation unique if this field is changed"

Browse Popular Code Answers by Language