I'm getting a 'creating default object from empty value' error.
$roomtype = Roomtype::where('name', '=' ,$roomtype_name)->first();
$roomtype -> availability -=1 ;
$roomtype -> save();
return $roomtype;
$roomtype
is not returning NULL.
$roomtype->availabilty-=1
also returns a value. I tried this in php artisan tinker and it works perfectly.
Then why is it not working in my controller?
via Sai Krishna