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.
xshop/resources/views/segments/footer/LittleFooter/LittleFooter.php

30 lines
916 B
PHP

<?php
namespace Resources\Views\Segments;
use App\Models\Part;
use App\Models\Setting;
class LittleFooter
{
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;
}
}