where('user_id', Auth::user()->id)->first(); if (!is_null($model)) { return $model; } } throw new NotFoundHttpException; } /** * @param $status */ public function change($status) { $this->status = $status; $this->save(); } /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function user() { return $this->belongsTo('FireflyIII\User'); } /** * @param $value * * @return mixed */ public function getConfigurationAttribute($value) { if (strlen($value) == 0) { return []; } return json_decode($value); } /** * @param $value */ public function setConfigurationAttribute($value) { $this->attributes['configuration'] = json_encode($value); } }