@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (! function_exists('getClassesList')) { |
|
| 3 | +if (!function_exists('getClassesList')) { |
|
| 4 | 4 | function getClassesList($dir) |
| 5 | 5 | { |
| 6 | 6 | $classes = \File::allFiles($dir); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | return $classes; |
| 16 | 16 | } |
| 17 | 17 | } |
| 18 | -if (! function_exists('getAllModelNames')) { |
|
| 18 | +if (!function_exists('getAllModelNames')) { |
|
| 19 | 19 | function getAllModelNames($dir) |
| 20 | 20 | { |
| 21 | 21 | $modelNames = []; |
@@ -29,42 +29,42 @@ discard block |
||
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | -if (! function_exists('validImageFolder')) { |
|
| 32 | +if (!function_exists('validImageFolder')) { |
|
| 33 | 33 | function validImageFolder($name, $default = 'default') |
| 34 | 34 | { |
| 35 | 35 | return strtolower(str_replace([' ', '-', '$', '<', '>', '&', '{', '}', '*', '\\', '/', ':', '.', ';', ',', "'", '"'], '_', $name ?? trim($default))); |
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | -if (! function_exists('getImagePlaceholder')) { |
|
| 39 | +if (!function_exists('getImagePlaceholder')) { |
|
| 40 | 40 | function getImagePlaceholder() |
| 41 | 41 | { |
| 42 | 42 | return asset('adminetic/static/placeholder.png'); |
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | -if (! function_exists('getVerticalImagePlaceholder')) { |
|
| 46 | +if (!function_exists('getVerticalImagePlaceholder')) { |
|
| 47 | 47 | function getVerticalImagePlaceholder() |
| 48 | 48 | { |
| 49 | 49 | return asset('adminetic/static/vertical_placeholder.jpg'); |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | -if (! function_exists('getSliderPlaceholder')) { |
|
| 53 | +if (!function_exists('getSliderPlaceholder')) { |
|
| 54 | 54 | function getSliderPlaceholder() |
| 55 | 55 | { |
| 56 | 56 | return asset('adminetic/static/slider.jpg'); |
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | -if (! function_exists('getFoodImagePlaceholder')) { |
|
| 60 | +if (!function_exists('getFoodImagePlaceholder')) { |
|
| 61 | 61 | function getFoodImagePlaceholder() |
| 62 | 62 | { |
| 63 | 63 | return asset('adminetic/static/food_placeholder.jpg'); |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | -if (! function_exists('getProfilePlaceholder')) { |
|
| 67 | +if (!function_exists('getProfilePlaceholder')) { |
|
| 68 | 68 | function getProfilePlaceholder($p = null) |
| 69 | 69 | { |
| 70 | 70 | $profile = $p ?? Auth::user()->profile ?? Auth::user()->profile()->create(); |
@@ -73,77 +73,77 @@ discard block |
||
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | -if (! function_exists('title')) { |
|
| 76 | +if (!function_exists('title')) { |
|
| 77 | 77 | function title() |
| 78 | 78 | { |
| 79 | 79 | return setting('title', config('adminetic.name', 'Adminetic')); |
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | -if (! function_exists('loader_enabled')) { |
|
| 83 | +if (!function_exists('loader_enabled')) { |
|
| 84 | 84 | function loader_enabled() |
| 85 | 85 | { |
| 86 | 86 | return setting('loader_enabled', config('adminetic.loader_enabled', true)); |
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | -if (! function_exists('favicon')) { |
|
| 90 | +if (!function_exists('favicon')) { |
|
| 91 | 91 | function favicon() |
| 92 | 92 | { |
| 93 | 93 | return setting('favicon') ? (asset('storage/'.setting('favicon'))) : asset('adminetic/static/favicon.png'); |
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | -if (! function_exists('logo')) { |
|
| 97 | +if (!function_exists('logo')) { |
|
| 98 | 98 | function logo() |
| 99 | 99 | { |
| 100 | 100 | return setting('logo') ? (asset('storage/'.setting('logo'))) : asset('adminetic/static/logo.png'); |
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | -if (! function_exists('dark_logo')) { |
|
| 104 | +if (!function_exists('dark_logo')) { |
|
| 105 | 105 | function dark_logo() |
| 106 | 106 | { |
| 107 | 107 | return setting('dark_logo') ? (asset('storage/'.setting('dark_logo'))) : asset('adminetic/static/logo_dark.png'); |
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | -if (! function_exists('getLogoBanner')) { |
|
| 111 | +if (!function_exists('getLogoBanner')) { |
|
| 112 | 112 | function getLogoBanner() |
| 113 | 113 | { |
| 114 | 114 | return setting('logo_banner') ? (asset('storage/'.setting('logo_banner'))) : asset('adminetic/static/logo_banner.jpg'); |
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | -if (! function_exists('login_register_bg_image')) { |
|
| 118 | +if (!function_exists('login_register_bg_image')) { |
|
| 119 | 119 | function login_register_bg_image() |
| 120 | 120 | { |
| 121 | 121 | return setting('login_register_bg_image') ? (asset('storage/'.setting('login_register_bg_image'))) : asset('adminetic/static/login_register_bg_img.jpg'); |
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | -if (! function_exists('getLazyLoadImg')) { |
|
| 125 | +if (!function_exists('getLazyLoadImg')) { |
|
| 126 | 126 | function getLazyLoadImg() |
| 127 | 127 | { |
| 128 | 128 | return asset('adminetic/static/loader.svg'); |
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | -if (! function_exists('random_color_part')) { |
|
| 132 | +if (!function_exists('random_color_part')) { |
|
| 133 | 133 | function random_color_part() |
| 134 | 134 | { |
| 135 | 135 | return str_pad(dechex(mt_rand(0, 255)), 2, '0', STR_PAD_LEFT); |
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | -if (! function_exists('random_color')) { |
|
| 139 | +if (!function_exists('random_color')) { |
|
| 140 | 140 | function random_color() |
| 141 | 141 | { |
| 142 | 142 | return random_color_part().random_color_part().random_color_part(); |
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | -if (! function_exists('setting')) { |
|
| 146 | +if (!function_exists('setting')) { |
|
| 147 | 147 | function setting($setting_name, $default = null) |
| 148 | 148 | { |
| 149 | 149 | $valid_setting_name = strtolower(str_replace(' ', '_', $setting_name)); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | -if (! function_exists('preference')) { |
|
| 156 | +if (!function_exists('preference')) { |
|
| 157 | 157 | function preference($preference_name, bool $default = null) |
| 158 | 158 | { |
| 159 | 159 | $valid_preference_name = strtolower(str_replace(' ', '_', $preference_name)); |
@@ -167,25 +167,25 @@ discard block |
||
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | -if (! function_exists('deleteImage')) { |
|
| 170 | +if (!function_exists('deleteImage')) { |
|
| 171 | 171 | function deleteImage($image) |
| 172 | 172 | { |
| 173 | 173 | $image ? (\Illuminate\Support\Facades\File::exists(public_path('storage/'.$image)) ? \Illuminate\Support\Facades\File::delete(public_path('storage/'.$image)) : '') : ''; |
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | -if (! function_exists('darkMode')) { |
|
| 177 | +if (!function_exists('darkMode')) { |
|
| 178 | 178 | function darkMode() |
| 179 | 179 | { |
| 180 | 180 | return setting('dark_mode', config('adminetic.dark_mode', false)); |
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | -if (! function_exists('getCondition')) { |
|
| 184 | +if (!function_exists('getCondition')) { |
|
| 185 | 185 | function getCondition($conditions) |
| 186 | 186 | { |
| 187 | 187 | $result = null; |
| 188 | - if (! isset($conditions)) { |
|
| 188 | + if (!isset($conditions)) { |
|
| 189 | 189 | return false; |
| 190 | 190 | } |
| 191 | 191 | |