Laravel validation exists where NOT

后端 未结 6 1889
温柔的废话
温柔的废话 2021-02-04 04:58

Based on the documentations. Exists can have 4 parameters:

exists:table,id,where,0

The question is, What if I wanted it to be where is not. Lik

6条回答
  •  再見小時候
    2021-02-04 05:37

    I know you're looking for 'not 0', but for reference sake, you can use NOT_NULL, as in:

    'groups' => 'required|exists:groups,jid,parent,NOT_NULL'
    

    It's not listed in the docs right now, but here is the discussion about it (see very last post)

提交回复
热议问题