Home > Q&A > body text
It is a field unique verification, in addition to itself, there are soft deleted records
某草草2017-05-16 16:50:14
Use the following method
1
2
3
4
<code>'email' => Rule::unique('users')->where(function ($query) {
<code>
'email'
=> Rule::unique(
'users'
)->where(
function
(
$query
) {
$query->whereNotNull('deleted_at')->whereNot('id', 4);
->whereNotNull(
'deleted_at'
)->whereNot(
'id'
, 4);
})
</code>
Refer to the official documentation https://laravel.com/docs/5.4/...