How to insert multiple rows in once laravel 5.3 : I want to insert an array with an id : blade.php
[enter image description here][1]

`<tr>
    <td class="text-left">{{$count}}</td>
    <td class="text-left"><img src="{{ asset('/' . $data->image_file) }}" class="img-circle" width="35px" height="35px"/></td>
    <td class="text-left">{{$data->student_id}}</td>
    <td class="text-left">
        {{ App\Models\student_subject:: where('id', '=', $subject)->value('sub_name') }}
    </td>

    <td class="text-left"> <input type="text" class="form-control"  placeholder="Mark" name="sub_mark[]" max="100" data-parsley-max="100" required="" data-parsley-required-message ="Subject Mark is required" data-parsley-trigger="change focusout"> </td>

    <td class="text-left"> <input type="text" class="form-control" placeholder="Class Test Mark" name="ct_mark[]" max="20" data-parsley-max="20" required="" data-parsley-required-message ="CT Mark is required" data-parsley-trigger="change focusout"> </td>
</tr>
<input type="hidden" name="student_id" value="{{$data->student_id}}" >
<input type="hidden" name="sub_name" value="{{$subject }}">`


when I tried to submit the form , it insert rows with same id..
[enter image description here][2]


  [1]: https://i.stack.imgur.com/G6l2y.png

here is my controller

  [2]: https://i.stack.imgur.com/iQn6K.png

    public function PostAddResult(Request $request) {
    $student_id= $request->input('student_id');
    $sub_name= $request->input('sub_name');
    $class_name= Session::get('class_name');
    $exam_id= Session::get('exam_name');

    $sub_mark= $request->input('sub_mark');
    $ct_mark= $request->input('ct_mark');

     $i = 0;
     foreach($sub_mark as $marks){

        $student_res = new student_results();
        $student_res->student_id = $student_id;
        $student_res->class_name = $class_name;
        $student_res->sub_name = $sub_name;
        $student_res->sub_mark = $marks;
        $student_res->ct_mark = $ct_mark[$i];
        $student_res->exam_id = $exam_id;
        $student_res->save();

     }

     $notification = array(
                'message'=>'Student Marks Add Successfully',
                'alert-type'=>'success',
            );

    return redirect('/addResult')->with($notification);

    }