mirror of https://github.com/4xmen/xshop.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
916 B
PHTML
31 lines
916 B
PHTML
2 months ago
|
<?php
|
||
|
|
||
|
namespace Resources\Views\Segments;
|
||
|
|
||
|
use App\Models\Part;
|
||
|
use App\Models\Setting;
|
||
|
|
||
|
class SpliterText
|
||
|
{
|
||
|
public static function onAdd(Part $part = null)
|
||
|
{
|
||
|
$setting = new Setting();
|
||
|
$setting->section = 'theme';
|
||
|
$setting->key = $part->area_name . '_' . $part->part.'_text';
|
||
|
$setting->value = 'A usually green, flattened, lateral structure attached to a stem and functioning as a principal organ of photosynthesis and transpiration in most plants.';
|
||
|
$setting->type = 'EDITOR';
|
||
|
$setting->size = 12;
|
||
|
$setting->title = $part->area_name . ' ' . $part->part .' text';
|
||
|
$setting->save();
|
||
|
}
|
||
|
public static function onRemove(Part $part = null)
|
||
|
{
|
||
|
Setting::where('key',$part->area_name . '_' . $part->part.'_text')->first()?->delete();
|
||
|
|
||
|
}
|
||
|
public static function onMount(Part $part = null)
|
||
|
{
|
||
|
return $part;
|
||
|
}
|
||
|
}
|