I have a project where I have one field that currently adds its contents to one field in my database with the name Total. What I would like to do is be able to submit the input to two fields (which is easy enough), but on the rare occasion, I would like it to default the second field (balance) to 0.
So, at the current moment, here is a portion of my controller:
$shipment->noCharge = request('noCharge');
$shipment->noSettle = request('noSettle');
$shipment->Total = request('Total');
I would like to be able to do something like:
$shipment->noCharge = request('noCharge');
$shipment->noSettle = request('noSettle');
$shipment->Total = request('Total');
$shipment->Balance =
//if (request('noCharge') = 1)
// 0.00
//else if (request('noSettle') = 1)
// 0.00
//else
request('Total');
//
Obviously my above won't work, but I hope it properly portrays what I am trying to do.