我们如何使用eloquent选择和更新laravel 5.4中的表?

I am working in laravel 5.4 and trying to select few data from table and update a field of table. I followed below script. I am not sure Is this correct method or not. Please correct me.

$bookings   = Booking::where('is_delete', 0)
            ->where('status', '1')
            ->where('payment_status', '1')
            ->get();

foreach($bookings as $booking) {
    $booking->status = '3';
    $booking->save();
}

Try This

$bookings   = Booking::where('is_delete', 0)
                ->where('status', '1')
                ->where('payment_status', '1')
                ->get();

foreach($bookings as $booking) 
{
    Booking::where('id',$booking->id)->update(['status'=>'3']);
}

you can simply update like

Booking::where('is_delete', 0)->where('status', '1')->where('payment_status', '1')->update(['status'=>'3']);

More Simple Update Coding...

Booking::where([['is_delete', '=', 0], ['status', '=', '1'], ['payment_status', '=', '1']])->update(['status' => '3']);