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;
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire