use Illuminate\Validation\Rule;

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

 

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

相关文章:

  • 2021-11-28
  • 2022-12-23
  • 2021-08-06
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
  • 2021-08-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案