belongsTo('User'); } /** * Expected data in this value: * * type: Piggybank, Test * action_uri: where to go when the user wants to do this? * text: full text to present to user * amount: any relevant amount. * model: id of relevant model. * * @param $value * * @return mixed */ public function getDataAttribute($value) { return json_decode($value); } /** * @param $value */ public function setDataAttribute($value) { $this->attributes['data'] = json_encode($value); } }