Object of class App\city_cost could not be converted to int

I am using laravel helpers function. I am passing an argument to it that contains a value which I want to use to update the user table a field cold totcosty. But Everytime it is showing me this error. This is the helper function

 Class Helper{
public static function cost($citycos)
{

$user = new User();

$user->totcosty += $citycos;
$user->update();
}

}

This is where I passed the value

public function store(Storecit $request)
{
$citycos->cost=$request->input('city_cost');
$citycos->save();
$test = Helper::cost($citycos);

}



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

تعليقات

المشاركات الشائعة من هذه المدونة

I am unable to figure out how to create payment collection request, after a form has been submitted in laravel

laravel, mysql transaction not working after failed one time