Laravel - Update only selected data

Laravel - Update only selected data

I have a table and inside the table i have textbox here take a look for the Page.

I have a table and inside the table i have textbox here take a look for the Page.

now the problem is whenever i update specific row or id, then it updates everything. how can i just update the sepecific row or id without updating everything? thank you verymuch

here is my controller

 public function updateSchedule(Request $request, $id)
{
    $timein = $request->input('timeIn');
    $timeout = $request->input('timeOut');

DB::table('schedules')
    ->update(['time_in' => $timein, 'time_out' => $timeout]);

$notification = array(
    'message' => 'Employee Time Updated!',
    'alert-type' => 'success'
);
return redirect()->back()->with($notification, 'Employee Time Updated!');

}

and here is my view

    {!! Form::open(['action' => ['Admin\[email protected]', $employee->id], 'method' => 'POST']) !!}

    <div class="row">
        <div class="form-group col-md-12">

            <small>Employee No. and Name: </small><b><i> {{ $employee->employee_no }} : {{ $employee->last_name }}, {{ $employee->first_name }}</i></b>

            <input type="hidden" name="hidEmployeeno" value='<?php echo $employee->employee_no ?>'>
            <input type="hidden" name="hidEmployeeLast" value='<?php echo $employee->last_name ?>'>
            <input type="hidden" name="hidEmployeeFirst" value='<?php echo $employee->first_name ?>'>
            <hr>

        </div>

</div>

    <table class="table">
        <thead>
          <tr>
            <th>DATE</th>
            <th>TIME IN</th>
            <th>LUNCH</th>
            <th>TIME OUT</th>
            <th>TOTAL HOURS</th>
            <th>STATUS</th>

          </tr>
        </thead>
        <tbody>

                @foreach ($employeeSched as $setTime)
          <tr>

             <td> {{Form::label('date_today', $setTime->date_today,['class'=>'form-control'])}}</td>
             <td><input type="time" name="timeIn" class="form-control col-md-10" value='{{ $setTime->time_in }}'></td>
             <td><p>12:00 PM - 1:00 PM</p></td>
             <td><input type="time" name="timeOut" class="form-control col-md-10" value='{{ $setTime->time_out }}'></td>
             <td>@php
                $time1 = strtotime($setTime->time_in);
                $time2 = strtotime($setTime->time_out);
                $difference = round(abs($time2 - $time1) / 3600,2);
                $total = $difference - 1;
                echo '<b>' . $total . '</b>';
             @endphp</td>


            <td>
                @php
                if ($total < 8) {
                    echo '<b>Late</b>';
                } else if($total > 8) {
                    echo '<b>OT</b>';
                } elseif ($total < 8.5 && $total == 8) {
                    echo '<b>In</b>';
                }


                @endphp
            </td>
          </tr>
          @endforeach



        </tbody>
</table>
{{Form::button('<i class="fa fa-clock">  UPDATE TIME</i>',['type' => 'submit','class' => 'btn btn-info btn-sm',  'style'=>"display: inline-block;"])}}
{{Form::hidden('_method', 'PUT')}}

{!! Form::close() !!}

thank you kind help me please thanks

php sql laravel

What's new in Bootstrap 5 and when Bootstrap 5 release date?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Random Password Generator Online

HTML Color Picker online | HEX Color Picker | RGB Color Picker

Introduction to Structured Query Language SQL pdf

SQL stands for Structured Query Language. SQL is a scripting language expected to store, control, and inquiry information put away in social databases. The main manifestation of SQL showed up in 1974, when a gathering in IBM built up the principal model of a social database. The primary business social database was discharged by Relational Software later turning out to be Oracle.

SQL to Laravel Migration Generator

Laravel Migration Generator helps you to generate laravel migration file from your existing table schema in online. Just enter your SQL table schema and get Laravel migration file. It is really simple to make Laravel migration file online from your existing database table.

Laravel Sanctum vs Passport

After the Laravel Sanctum package was released? Everywhere question was asked that When to use Sanctum and when to use Passport? So, in this video, you will ...

Clear Cache in Laravel 6.8 App using Artisan Command Interface (CLI)

In Laravel 6 tutorial, we learn how to use PHP artisan command interface (CLI) to clear the cache from Laravel 6.8 application. How To Clear Cache in Laravel 6.8 Application using Artisan Command Line Interface (CLI)? How to clear route cache using php artisan command? How to easily clear cache in Laravel application? How to clear config cache in PHP Laravel via artisan command? How to clear Laravel view cache? How to Reoptimized class in Laravel via artisan CLI?

Hire Dedicated PHP Developer

Looking to hire affordable yet experienced PHP developers? **[Hire Dedicated PHP Developer](https://hourlydeveloper.io/hire-dedicated-php-developer/ "Hire Dedicated PHP Developer")**, who can convert your idea to reality, within the stipulated...