title: Laravel Inserting Data Only the Last List or Data
body: <p>I want to insert the data specifically look at my page. </p>
  
  <p><a href="https://i.stack.imgur.com/Iadv0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Iadv0.png" alt="enter image description here"></a></p>
  
  <p>When I set time the data will be inserted. But what I have right now is the data that is inserted is the very last data on this table which is <code>January-31-2019</code> how can I fix it so when I insert data, the data will insert any of the data that is list on the table.</p>
  
  <p><strong>Controller</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>public function insertSchedule(Request $request)
  {
      $employeeTimeSet = new Schedule;
      $employeeTimeSet-&gt;employee_no = $request-&gt;input('hidEmployeeno');
      $employeeTimeSet-&gt;last_name = $request-&gt;input('hidEmployeeLast');
      $employeeTimeSet-&gt;first_name = $request-&gt;input('hidEmployeeFirst');
      $employeeTimeSet-&gt;date_today = $request-&gt;input('dateToday');
      $employeeTimeSet-&gt;time_in = $request-&gt;input('timeIn');
      $employeeTimeSet-&gt;time_out = $request-&gt;input('timeOut');
      $employeeTimeSet-&gt;save();
  
      $notification = array(
          'message' =&gt; 'Click PLAN TIME! Employee Time Set!',
          'alert-type' =&gt; 'success'
      );
  
      return redirect()-&gt;back()-&gt;with($notification, 'Employee Time Set');
  }
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>{!! Form::open(['action' =&gt; 'Admin\EmployeeFilemController@insertSchedule', 'method' =&gt; 'POST']) !!}
  &lt;div class="row"&gt;
      &lt;div class="form-group col-md-12"&gt;
          &lt;small&gt;Employee No. and Name:&lt;/small&gt;
          &lt;b&gt;&lt;i&gt; {{ $employee-&gt;employee_no }} : {{ $employee-&gt;last_name }}, {{ $employee-&gt;first_name }}&lt;/i&gt;&lt;/b&gt;
          &lt;input type="hidden" name="hidEmployeeno" value='&lt;?php echo $employee-&gt;employee_no ?&gt;'&gt;
          &lt;input type="hidden" name="hidEmployeeLast" value='&lt;?php echo $employee-&gt;last_name ?&gt;'&gt;
          &lt;input type="hidden" name="hidEmployeeFirst" value='&lt;?php echo $employee-&gt;first_name ?&gt;'&gt;
          &lt;hr&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  @php
      $today = today(); 
      $dates = []; 
  
      for($i=1; $i &lt; $today-&gt;daysInMonth + 1; ++$i) {
          $dates[] = \Carbon\Carbon::createFromDate($today-&gt;year, $today-&gt;month, $i)-&gt;format('F-d-Y');
      }
  @endphp
  
  &lt;table class="table"&gt;
      &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;DATE TODAY&lt;/th&gt;
          &lt;th&gt;TIME IN&lt;/th&gt;
          &lt;th&gt;TIME OUT&lt;/th&gt;
          &lt;th&gt;ACTION&lt;/th&gt;
      &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
      @foreach($dates as $date)
          &lt;tr&gt;
              &lt;td&gt;&lt;b&gt;{{ $date }}&lt;/b&gt;&lt;/td&gt;
              &lt;input type="hidden" name="dateToday" value="{{ $date }}"&gt;
              &lt;td&gt;&lt;input type="time" name="timeIn" class="form-control col-md-10"&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="time" name="timeOut" class="form-control col-md-10"&gt;&lt;/td&gt;
              &lt;td&gt; {{Form::button('&lt;i class="fa fa-clock"&gt;&amp;nbsp;&amp;nbsp;SET TIME&lt;/i&gt;',['type' =&gt; 'submit','class' =&gt; 'btn btn-warning btn-sm',  'style'=&gt;"display: inline-block;"])}}&lt;/td&gt;
          &lt;/tr&gt;
      @endforeach
      &lt;/tbody&gt;
  &lt;/table&gt;
  {!! Form::close() !!}
  </code></pre>