In one of my controllers, I am needing to update a specific record in another table. I have code to find the table, update the specific column, and save it. My problem is that the record is never updated. I have ensured that the column is fillable.
Here is the code that is giving me problems:
$portfolio = Portfolios::where('id', $request->portfolioID)->first();
$portfolio->totalValue = $portfolio->totalValue + $cd->currValue;
//dd($portfolio);
$portfolio->save();
At the die and dump that is commented out, I can compare the attributes shows the correct value and the original value was the previous value, which is still retained after the save.
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2y0jLOR
via IFTTT
Aucun commentaire:
Enregistrer un commentaire