diff --git a/app/Services/ThemeHelper.php b/app/Services/ThemeHelper.php index f03cf1c..fa04413 100644 --- a/app/Services/ThemeHelper.php +++ b/app/Services/ThemeHelper.php @@ -10,10 +10,10 @@ class ThemeHelper public static function appClasses(): array { - $data = config('custom.custom'); + $data = config('theme.custom'); // default data array - $DefaultData = [ + $defaultData = [ 'myLayout' => 'vertical', 'myTheme' => 'theme-default', 'myStyle' => 'light', @@ -44,7 +44,7 @@ public static function appClasses(): array ]; // if any key missing of array from custom.php file it will be merge and set a default value from dataDefault array and store in data variable - $data = array_merge($DefaultData, $data); + $data = array_merge($defaultData, $data); // All options available in the template $allOptions = [ @@ -70,8 +70,8 @@ public static function appClasses(): array // if myLayout value empty or not match with default options in custom.php config file then set a default value foreach ($allOptions as $key => $value) { - if (array_key_exists($key, $DefaultData)) { - if (gettype($DefaultData[$key]) === gettype($data[$key])) { + if (array_key_exists($key, $defaultData)) { + if (gettype($defaultData[$key]) === gettype($data[$key])) { // data key should be string if (is_string($data[$key])) { // data key should not be empty @@ -81,16 +81,16 @@ public static function appClasses(): array // ensure that passed value should be match with any of allOptions array value $result = array_search($data[$key], $value, 'strict'); if (empty($result) && $result !== 0) { - $data[$key] = $DefaultData[$key]; + $data[$key] = $defaultData[$key]; } } } else { // if data key not set or - $data[$key] = $DefaultData[$key]; + $data[$key] = $defaultData[$key]; } } } else { - $data[$key] = $DefaultData[$key]; + $data[$key] = $defaultData[$key]; } } } @@ -98,7 +98,7 @@ public static function appClasses(): array $styleUpdatedVal = $data['myStyle'] == 'dark' ? 'dark' : $data['myStyle']; // Determine if the layout is admin or front based on cookies $layoutName = $data['myLayout']; - $isAdmin = Str::contains($layoutName, 'front') ? false : true; + $isAdmin = ! Str::contains($layoutName, 'front'); $modeCookieName = $isAdmin ? 'admin-mode' : 'front-mode'; $colorPrefCookieName = $isAdmin ? 'admin-colorPref' : 'front-colorPref'; @@ -143,7 +143,7 @@ public static function appClasses(): array ]; // sidebar Collapsed - if ($layoutClasses['menuCollapsed'] == true) { + if ($layoutClasses['menuCollapsed']) { $layoutClasses['menuCollapsed'] = 'layout-menu-collapsed'; } @@ -161,17 +161,17 @@ public static function appClasses(): array } // Menu Fixed - if ($layoutClasses['menuFixed'] == true) { + if ($layoutClasses['menuFixed']) { $layoutClasses['menuFixed'] = 'layout-menu-fixed'; } // Footer Fixed - if ($layoutClasses['footerFixed'] == true) { + if ($layoutClasses['footerFixed']) { $layoutClasses['footerFixed'] = 'layout-footer-fixed'; } // Menu Flipped - if ($layoutClasses['menuFlipped'] == true) { + if ($layoutClasses['menuFlipped']) { $layoutClasses['menuFlipped'] = 'layout-menu-flipped'; } @@ -181,12 +181,12 @@ public static function appClasses(): array // } // RTL Supported template - if ($layoutClasses['rtlSupport'] == true) { + if ($layoutClasses['rtlSupport']) { $layoutClasses['rtlSupport'] = '/rtl'; } // RTL Layout/Mode - if ($layoutClasses['rtlMode'] == true) { + if ($layoutClasses['rtlMode']) { $layoutClasses['rtlMode'] = 'rtl'; $layoutClasses['textDirection'] = isset($_COOKIE['direction']) ? ($_COOKIE['direction'] === 'true' ? 'rtl' : 'ltr') : 'rtl'; @@ -197,14 +197,14 @@ public static function appClasses(): array } // Show DropdownOnHover for Horizontal Menu - if ($layoutClasses['showDropdownOnHover'] == true) { + if ($layoutClasses['showDropdownOnHover']) { $layoutClasses['showDropdownOnHover'] = true; } else { $layoutClasses['showDropdownOnHover'] = false; } // To hide/show display customizer UI, not js - if ($layoutClasses['displayCustomizer'] == true) { + if ($layoutClasses['displayCustomizer']) { $layoutClasses['displayCustomizer'] = true; } else { $layoutClasses['displayCustomizer'] = false; diff --git a/bootstrap/providers.php b/bootstrap/providers.php index 55e8e15..a7d8c85 100644 --- a/bootstrap/providers.php +++ b/bootstrap/providers.php @@ -4,4 +4,5 @@ App\Providers\AppServiceProvider::class, App\Providers\FortifyServiceProvider::class, App\Providers\JetstreamServiceProvider::class, + App\Providers\MenuServiceProvider::class, ]; diff --git a/config/theme.php b/config/theme.php new file mode 100644 index 0000000..a08580a --- /dev/null +++ b/config/theme.php @@ -0,0 +1,34 @@ + [ + 'myLayout' => 'vertical', // Options[String]: vertical(default), horizontal + 'myTheme' => 'theme-default', // Options[String]: theme-default(default), theme-bordered, theme-semi-dark + 'myStyle' => 'light', // Options[String]: light(default), dark & system mode + 'myRTLSupport' => true, // options[Boolean]: true(default), false // To provide RTLSupport or not + 'myRTLMode' => false, // options[Boolean]: false(default), true // To set layout to RTL layout (myRTLSupport must be true for rtl mode) + 'hasCustomizer' => true, // options[Boolean]: true(default), false // Display customizer or not THIS WILL REMOVE INCLUDED JS FILE. SO LOCAL STORAGE WON'T WORK + 'displayCustomizer' => true, // options[Boolean]: true(default), false // Display customizer UI or not, THIS WON'T REMOVE INCLUDED JS FILE. SO LOCAL STORAGE WILL WORK + 'contentLayout' => 'compact', // options[String]: 'compact', 'wide' (compact=container-xxl, wide=container-fluid) + 'navbarType' => 'sticky', // options[String]: 'sticky', 'static', 'hidden' (Only for vertical Layout) + 'footerFixed' => false, // options[Boolean]: false(default), true // Footer Fixed + 'menuFixed' => true, // options[Boolean]: true(default), false // Layout(menu) Fixed (Only for vertical Layout) + 'menuCollapsed' => false, // options[Boolean]: false(default), true // Show menu collapsed, (Only for vertical Layout) + 'headerType' => 'fixed', // options[String]: 'static', 'fixed' (for horizontal layout only) + 'showDropdownOnHover' => true, // true, false (for horizontal layout only) + 'customizerControls' => [ + 'rtl', + 'style', + 'headerType', + 'contentLayout', + 'layoutCollapsed', + 'layoutNavbarOptions', + 'themes', + ], // To show/hide customizer options + ], +]; diff --git a/config/variables.php b/config/variables.php new file mode 100644 index 0000000..2f31d81 --- /dev/null +++ b/config/variables.php @@ -0,0 +1,29 @@ + 'Dr. Masroor Ehsan', + 'creatorUrl' => 'https://google.com', + 'templateName' => 'RadSparc', + 'templateSuffix' => 'RadSparc PACS', + 'templateVersion' => '2.0.1', + 'templateFree' => false, + 'templateDescription' => 'RadSparc – is the most developer friendly & highly customizable Admin Dashboard Template.', + 'templateKeyword' => 'dashboard, material, material design, bootstrap 5 dashboard, bootstrap 5 design, bootstrap 5', + 'licenseUrl' => 'https://themeforest.net/licenses/standard', + 'livePreview' => 'https://pixinvent.com/materialize-bootstrap-laravel-admin-template/', + 'productPage' => 'https://1.envato.market/materialize_admin', + 'support' => 'https://pixinvent.ticksy.com/', + 'moreThemes' => 'https://1.envato.market/pixinvent_portfolio', + 'documentation' => 'https://demos.pixinvent.com/materialize-html-admin-template/documentation', + 'generator' => '', + 'changelog' => 'https://demos.pixinvent.com/materialize/changelog.html', + 'repository' => 'https://github.com/pixinvent/materialize-html-laravel-admin-template', + 'gitRepo' => 'materialize-html-laravel-admin-template', + 'gitRepoAccess' => 'https://tools.pixinvent.com/github/github-access', + 'facebookUrl' => 'https://www.facebook.com/pixinvents/', + 'twitterUrl' => 'https://twitter.com/pixinvents', + 'githubUrl' => 'https://github.com/pixinvent', + 'dribbbleUrl' => 'https://dribbble.com/pixinvent', + 'instagramUrl' => 'https://www.instagram.com/pixinvents/', +]; diff --git a/resources/views/policy.blade.php b/resources/views/policy.blade.php index b5caf52..b53ec0c 100644 --- a/resources/views/policy.blade.php +++ b/resources/views/policy.blade.php @@ -1,6 +1,6 @@ @php -$configData = Helper::appClasses(); -$customizerHidden = 'customizer-hide'; + $configData = \App\Services\ThemeHelper::appClasses(); + $customizerHidden = 'customizer-hide'; @endphp @extends('layouts/blankLayout') diff --git a/resources/views/terms.blade.php b/resources/views/terms.blade.php index 18949c4..ad50762 100644 --- a/resources/views/terms.blade.php +++ b/resources/views/terms.blade.php @@ -1,6 +1,6 @@ @php -$configData = Helper::appClasses(); -$customizerHidden = 'customizer-hide'; + $configData = \App\Services\ThemeHelper::appClasses(); + $customizerHidden = 'customizer-hide'; @endphp @extends('layouts/blankLayout')