. */ declare(strict_types=1); namespace FireflyIII\Models; use FireflyIII\Support\Models\ReturnsIntegerIdTrait; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; /** * @mixin IdeHelperConfiguration */ class Configuration extends Model { use ReturnsIntegerIdTrait; use SoftDeletes; protected $casts = [ 'created_at' => 'datetime', 'updated_at' => 'datetime', 'deleted_at' => 'datetime', ]; /** @var string The table to store the data in */ protected $table = 'configuration'; /** * TODO can be replaced with native laravel code. * * @param mixed $value * * @return mixed */ public function getDataAttribute($value) { return json_decode($value); } /** * @param mixed $value */ public function setDataAttribute($value): void { $this->attributes['data'] = json_encode($value); } }