Jul 9, 2022
8
Level 1
How to check if request array is empty in laravel?
I have an input field in a form. Its is an array type. How can i check if the field is empty or not?
<td><input type="text" name="exam_name[]" placeholder="Exam Name" class="form-control name_list" /></td>
When i dd($request->exan_name) it shows null. But if i didn't gave any value to the field and submits, null value is inserting into database. How can i prevent it?
Please or to participate in this conversation.