📜  exists:categories,id 除了值 laravel - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:43.834000             🧑  作者: Mango

代码示例1
There are two solutions that i found on the search

1. use laravel form select and prepend the null value in starting 
{!! Form::select('parent_id', $category_list->prepend('Select a parent (optional)', ''), $category->parent_id, ['class' => 'form-control']) !!}

2. Or use `sometimes` validation
  'email' => 'sometimes|required|email',
This will check if the value resides in the the data or column selected