Komp / Max Produkt,

This commit is contained in:
Kevin Adametz 2021-06-18 15:01:01 +02:00
parent a4c76d06fa
commit 78f43169c8
19 changed files with 347 additions and 51 deletions

View file

@ -77,6 +77,10 @@ class Setting extends Model
'object' => 'Object',
'full_text' => 'Full Text',
'text' => 'Text',
'int' => 'Zahl',
'bool' => 'Bool',
];
public function sluggable()
@ -103,6 +107,9 @@ class Setting extends Model
case 'int':
return $content->int;
break;
case 'bool':
return $content->int === 1 ? true : false;
break;
}
}
return false;
@ -120,17 +127,20 @@ class Setting extends Model
$content->type = $type;
switch ($content->type){
case 'object':
$content->object = $value;
$content->object = $value ? $value : null;;
break;
case 'full_text':
$content->full_text = $value;
$content->full_text = $value ? $value : null;;
break;
case 'text':
$content->text = $value;
$content->text = $value ? $value : null;;
break;
case 'int':
$content->int = (int) $value;
break;
case 'bool':
$content->int = $value ? 1 : 0;
break;
}
$content->save();