From 801de6ae1d671c9cd41f19bbd936fe6daec3cda1 Mon Sep 17 00:00:00 2001 From: A1Gard Date: Mon, 1 Jul 2024 03:38:05 +0330 Subject: [PATCH] added color to setting --- app/Helpers/Helper.php | 4 +++- app/Models/Setting.php | 2 +- resources/views/admin/commons/setting.blade.php | 2 +- resources/views/components/setting-field.blade.php | 10 ++++++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/Helpers/Helper.php b/app/Helpers/Helper.php index 2b022a7..3c36971 100644 --- a/app/Helpers/Helper.php +++ b/app/Helpers/Helper.php @@ -548,8 +548,10 @@ function validateSettingRequest($setting, $newValue) switch ($setting->key) { case 'optimize': - if ($newValue != 'jpg' || $newValue != 'webp') { + if ($newValue != 'jpg' && $newValue != 'webp') { return 'webp'; + }else{ + return $newValue; } case 'gallery_thumb': case 'post_thumb': diff --git a/app/Models/Setting.php b/app/Models/Setting.php index 5487721..4127891 100644 --- a/app/Models/Setting.php +++ b/app/Models/Setting.php @@ -13,5 +13,5 @@ class Setting extends Model public $translatable = ['value']; public static $settingTypes = ['TEXT', 'LONGTEXT', 'CODE', 'EDITOR', - 'CATEGORY', 'GROUP', 'CHECKBOX', 'FILE']; + 'CATEGORY', 'GROUP', 'CHECKBOX', 'FILE','COLOR']; } diff --git a/resources/views/admin/commons/setting.blade.php b/resources/views/admin/commons/setting.blade.php index 97293ee..5ce620f 100644 --- a/resources/views/admin/commons/setting.blade.php +++ b/resources/views/admin/commons/setting.blade.php @@ -62,7 +62,7 @@ + @break @case('FILE')
@php($ext = strtolower(pathinfo(str_replace('_','.',$setting->key), PATHINFO_EXTENSION))) @@ -87,9 +93,9 @@ @default @if($setting->key == 'optimize') @else