Set tags setter

This commit is contained in:
Julien Nahum 2022-10-27 23:31:05 +02:00
parent 35c49ff90c
commit 53272b033b
1 changed files with 8 additions and 0 deletions

View File

@ -153,6 +153,14 @@ class Form extends Model
$this->attributes['submitted_text'] = Purify::clean($value); $this->attributes['submitted_text'] = Purify::clean($value);
} }
public function setTagsAttribute($value)
{
if ($value == null || $value == '') {
$value = '[]';
}
$this->attributes['tags'] = json_encode($value);
}
public function getIsClosedAttribute() public function getIsClosedAttribute()
{ {
return ($this->closes_at && now()->gt($this->closes_at)); return ($this->closes_at && now()->gt($this->closes_at));