laravel 验证 unique 除了当前记录 验证唯一性

use Illuminate\Validation\Rule;

Rule::unique('helpness_type')->where(function($query)use($input){
return $query->where('id','!=',$input['id'])->where('deleted_at', null);
})

猜你喜欢

转载自www.cnblogs.com/JdsyJ/p/10421719.html