mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 20:22:07 +00:00
More code.
This commit is contained in:
@@ -5,11 +5,18 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Preference extends Model
|
||||
{
|
||||
|
||||
protected $fillable = ['user_id', 'data', 'name'];
|
||||
|
||||
public function getDataAttribute($value)
|
||||
{
|
||||
return json_decode($value);
|
||||
}
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at'];
|
||||
}
|
||||
|
||||
public function setDataAttribute($value)
|
||||
{
|
||||
$this->attributes['data'] = json_encode($value);
|
||||
@@ -19,9 +26,5 @@ class Preference extends Model
|
||||
{
|
||||
return $this->belongsTo('FireflyIII\User');
|
||||
}
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at'];
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user