exists:categories,id except a value laravel
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
Are there any code examples left?
New code examples in category PHP