laravel unique validation on update unique value code example
Example 1: laravel set field unique
Schema::table('manufacturers', function($table)
{
$table->string('name')->unique();
});
Example 2: set unique value validation for laravel form request
use Illuminate\Validation\Rule;
public function rules()
{
return [
'title' => [
'required',
Rule::unique('posts', 'title')->ignore($this->post)
]
];
}