data_encrypted)) { return json_decode($value); } $data = Crypt::decrypt($this->data_encrypted); return json_decode($data); } /** * @param $value */ public function setDataAttribute($value) { $this->attributes['data'] = ''; $this->attributes['data_encrypted'] = Crypt::encrypt(json_encode($value)); } /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function user() { return $this->belongsTo('FireflyIII\User'); } }