I have a controller that should update an amount attribute and save it to a db. I can verify via getAmount that the model has the correct amount, but its not being saved to the database and no error is returned. Any idea what I'm doing wrong?
Here's my controller:
$response = Input::json()->all();
$ticket = Ticket::find($id);
$ticket->setAmount($response['amount']);
$ticket->getAmount(); //for debugging
$ticket->save();
return $ticket;
And my Ticket Model:
class Ticket extends \Eloquent { protected $fillable = [];
protected $amount = 0;
function setAmount($amount){
$this->amount = $amount*100000000;
}
function getAmount(){
return $this->amount/100000000;
}
}