belongsToMany('FireflyIII\Models\TransactionJournal', 'category_transaction_journal', 'category_id'); } /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function user() { return $this->belongsTo('FireflyIII\User'); } /** * @param $value */ public function setNameAttribute($value) { $this->attributes['name'] = Crypt::encrypt($value); $this->attributes['encrypted'] = true; } /** * @param $value * * @return string */ public function getNameAttribute($value) { if (intval($this->encrypted) == 1) { return Crypt::decrypt($value); } // @codeCoverageIgnoreStart return $value; // @codeCoverageIgnoreEnd } }