@@ -14,7 +14,7 @@ |
||
| 14 | 14 | public function indexPermission() |
| 15 | 15 | { |
| 16 | 16 | $permissions = config('adminetic.caching', true) |
| 17 | - ? (Cache::has('permissions') ? Cache::get('permissions') : Cache::rememberForever('permissions', function () { |
|
| 17 | + ? (Cache::has('permissions') ? Cache::get('permissions') : Cache::rememberForever('permissions', function() { |
|
| 18 | 18 | return Permission::with('role')->get(); |
| 19 | 19 | })) |
| 20 | 20 | : Permission::with('role')->get(); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | public function indexRole() |
| 14 | 14 | { |
| 15 | 15 | $roles = config('adminetic.caching', true) |
| 16 | - ? (Cache::has('roles') ? Cache::get('roles') : Cache::rememberForever('roles', function () { |
|
| 16 | + ? (Cache::has('roles') ? Cache::get('roles') : Cache::rememberForever('roles', function() { |
|
| 17 | 17 | return Role::all(); |
| 18 | 18 | })) |
| 19 | 19 | : Role::all(); |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | public function indexSetting() |
| 16 | 16 | { |
| 17 | 17 | $settings = config('adminetic.caching', true) |
| 18 | - ? (Cache::has('settings') ? Cache::get('settings') : Cache::rememberForever('settings', function () { |
|
| 18 | + ? (Cache::has('settings') ? Cache::get('settings') : Cache::rememberForever('settings', function() { |
|
| 19 | 19 | return Setting::latest()->get(); |
| 20 | 20 | })) |
| 21 | 21 | : Setting::latest()->get(); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | public function indexPreference() |
| 16 | 16 | { |
| 17 | 17 | $preferences = config('adminetic.caching', true) |
| 18 | - ? (Cache::has('preferences') ? Cache::get('preferences') : Cache::rememberForever('preferences', function () { |
|
| 18 | + ? (Cache::has('preferences') ? Cache::get('preferences') : Cache::rememberForever('preferences', function() { |
|
| 19 | 19 | return Preference::latest()->get(); |
| 20 | 20 | })) |
| 21 | 21 | : Preference::latest()->get(); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $users = User::all(); |
| 40 | 40 | if (isset($users)) { |
| 41 | 41 | foreach ($users as $user) { |
| 42 | - if (! isset($preference->roles)) { |
|
| 42 | + if (!isset($preference->roles)) { |
|
| 43 | 43 | $preference->users()->attach($user->id, [ |
| 44 | 44 | 'enabled' => $preference->active, |
| 45 | 45 | ]); |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | $preferences = Preference::all(); |
| 91 | 91 | if (isset($preferences)) { |
| 92 | 92 | foreach ($preferences as $preference) { |
| 93 | - if (! isset($preference->roles)) { |
|
| 93 | + if (!isset($preference->roles)) { |
|
| 94 | 94 | $user->preferences()->attach($preference->id, [ |
| 95 | 95 | 'enabled' => $preference->active, |
| 96 | 96 | ]); |
@@ -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 | |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | case 3: |
| 56 | 56 | $this->resetPage(); |
| 57 | 57 | $role_id = $this->role ?? null; |
| 58 | - $data = $role_id == '' ? $default : $default->whereHas('roles', function ($query) use ($role_id) { |
|
| 58 | + $data = $role_id == '' ? $default : $default->whereHas('roles', function($query) use ($role_id) { |
|
| 59 | 59 | $query->where('role_id', $role_id); |
| 60 | 60 | }); |
| 61 | 61 | break; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | protected static function makeRestAPIController($name, $path) |
| 35 | 35 | { |
| 36 | - if (! file_exists($dir_path = app_path('Http/Controllers/Admin/API/Restful'))) { |
|
| 36 | + if (!file_exists($dir_path = app_path('Http/Controllers/Admin/API/Restful'))) { |
|
| 37 | 37 | mkdir($dir_path, 0777, true); |
| 38 | 38 | } |
| 39 | 39 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | // Making API Resource |
| 64 | 64 | self::makeAPIResource($name, $path); |
| 65 | 65 | // Making Controller |
| 66 | - if (! file_exists($dir_path = app_path('Http/Controllers/Admin/API/Client'))) { |
|
| 66 | + if (!file_exists($dir_path = app_path('Http/Controllers/Admin/API/Client'))) { |
|
| 67 | 67 | mkdir($dir_path, 0777, true); |
| 68 | 68 | } |
| 69 | 69 | $controllerTemplate = str_replace( |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | protected static function makeAPIResource($name, $path) |
| 88 | 88 | { |
| 89 | - if (! file_exists($dir_path = app_path("/Http/Resources/{$name}"))) { |
|
| 89 | + if (!file_exists($dir_path = app_path("/Http/Resources/{$name}"))) { |
|
| 90 | 90 | mkdir($dir_path, 0777, true); |
| 91 | 91 | } |
| 92 | 92 | // Making Collection |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | 'profile_pic' => $this->profile_pic->store('admin/user', 'public'), |
| 90 | 90 | ]); |
| 91 | 91 | $image = Image::make($this->profile_pic->getRealPath()); |
| 92 | - $image->save(public_path('storage/' . $profile->profile_pic)); |
|
| 92 | + $image->save(public_path('storage/'.$profile->profile_pic)); |
|
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |