Fix removed properties casting
This commit is contained in:
parent
2ab3f79801
commit
f0939f3992
|
@ -15,6 +15,7 @@ use Spatie\Sluggable\HasSlug;
|
||||||
use Spatie\Sluggable\SlugOptions;
|
use Spatie\Sluggable\SlugOptions;
|
||||||
use Stevebauman\Purify\Facades\Purify;
|
use Stevebauman\Purify\Facades\Purify;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||||
|
|
||||||
class Form extends Model
|
class Form extends Model
|
||||||
{
|
{
|
||||||
|
@ -218,9 +219,12 @@ class Form extends Model
|
||||||
return !empty($this->password);
|
return !empty($this->password);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRemovedPropertiesAttribute()
|
protected function removedProperties(): Attribute {
|
||||||
{
|
return Attribute::make(
|
||||||
return $this->attributes['removed_properties'] ?? [];
|
get: function ($value) {
|
||||||
|
return $value ? json_decode($value, true) : [];
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue