jeudi 8 mars 2018

BadMethodCallException Method save does not exist

I am trying to update a record in the database and am getting "Method save does not exist" ---- code looks like:

$listingsDB  = User::where('id', '=', auth()->id())->get();

  foreach($listingsDB as $numberOfListing){
      $listings = $numberOfListing->numberOfListings;
   }

  $listings = ++$listings;

  $listingsDB->numberOfListings = $listings;
  $listingsDB->save();

Any help appreciated. I can't see what I'm doing wrongs - Thanx



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

Aucun commentaire:

Enregistrer un commentaire