jeudi 13 février 2020

Laravel update table from public class helper not working

I want to update my table in my public class. But it is throwing error Method update does not exist. This is my class

public static function Update($id, $city){
    $hotel_name= hotel_info::all()->where('id', $id)->pluck('hotel_name');
    $user_id = auth()->user()->id;
    $plan_hotel_db = plan_hotel::where('travel_id', $user_id)->where('plan_city_id', $city)->get();

    $plan_hotel_db->hotel_name = $hotel_name;

    $plan_hotel_db->update();

    return $plan_hotel_db;
}


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2SGsmkn
via IFTTT

Aucun commentaire:

Enregistrer un commentaire