user_id == Auth::user()->id) { return $value; } } throw new NotFoundHttpException; } /** * @param $value * * @return string */ public function getMatchAttribute($value) { if (intval($this->match_encrypted) == 1) { return Crypt::decrypt($value); } return $value; } /** * @param $value * * @return string */ public function getNameAttribute($value) { if (intval($this->name_encrypted) == 1) { return Crypt::decrypt($value); } return $value; } /** * @param $value */ public function setAmountMaxAttribute($value) { $this->attributes['amount_max'] = strval(round($value, 2)); } /** * @param $value */ public function setAmountMinAttribute($value) { $this->attributes['amount_min'] = strval(round($value, 2)); } /** * @param $value */ public function setMatchAttribute($value) { $this->attributes['match'] = Crypt::encrypt($value); $this->attributes['match_encrypted'] = true; } /** * @param $value */ public function setNameAttribute($value) { $this->attributes['name'] = Crypt::encrypt($value); $this->attributes['name_encrypted'] = true; } /** * @return HasMany */ public function transactionjournals(): HasMany { return $this->hasMany('FireflyIII\Models\TransactionJournal'); } /** * @return BelongsTo */ public function user(): BelongsTo { return $this->belongsTo('FireflyIII\User'); } }