@@ -25,10 +25,10 @@ |
||
| 25 | 25 | |
| 26 | 26 | public function preferenceChanged(User $user, Preference $preference) |
| 27 | 27 | { |
| 28 | - $user->preferences()->updateExistingPivot($preference->id, ['enabled' => ! $this->enabled], false); |
|
| 28 | + $user->preferences()->updateExistingPivot($preference->id, ['enabled' => !$this->enabled], false); |
|
| 29 | 29 | |
| 30 | 30 | $this->preference = $preference; |
| 31 | - $this->enabled = ! $this->enabled; |
|
| 31 | + $this->enabled = !$this->enabled; |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public function render() |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $user = User::where('email', $socialiteuser->email)->first(); |
| 51 | 51 | |
| 52 | - if (! isset($user)) { |
|
| 52 | + if (!isset($user)) { |
|
| 53 | 53 | $user = User::create([ |
| 54 | 54 | 'name' => $socialiteuser->name, |
| 55 | 55 | 'email' => $socialiteuser->email, |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $preferences = Preference::all(); |
| 80 | 80 | if (isset($preferences)) { |
| 81 | 81 | foreach ($preferences as $preference) { |
| 82 | - if (! isset($preference->roles)) { |
|
| 82 | + if (!isset($preference->roles)) { |
|
| 83 | 83 | $user->preferences()->attach($preference->id, [ |
| 84 | 84 | 'enabled' => $preference->active, |
| 85 | 85 | ]); |
@@ -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 | ]); |
@@ -10,10 +10,10 @@ |
||
| 10 | 10 | { |
| 11 | 11 | public static function ImplementNow($name, $makeRequest = false) |
| 12 | 12 | { |
| 13 | - if (! file_exists($repository_path = app_path('/Repositories'))) { |
|
| 13 | + if (!file_exists($repository_path = app_path('/Repositories'))) { |
|
| 14 | 14 | mkdir($repository_path, 0777, true); |
| 15 | 15 | } |
| 16 | - if (! file_exists($contract_path = app_path('/Contracts'))) { |
|
| 16 | + if (!file_exists($contract_path = app_path('/Contracts'))) { |
|
| 17 | 17 | mkdir($contract_path, 0777, true); |
| 18 | 18 | } |
| 19 | 19 | |
@@ -57,9 +57,9 @@ |
||
| 57 | 57 | // Make a Policy |
| 58 | 58 | protected static function makePolicy($name, $only_flags) |
| 59 | 59 | { |
| 60 | - if (! $only_flags) { |
|
| 60 | + if (!$only_flags) { |
|
| 61 | 61 | if (trim($name) != 'User' || trim($name) != 'user') { |
| 62 | - if (! file_exists($path = app_path('Policies'))) { |
|
| 62 | + if (!file_exists($path = app_path('Policies'))) { |
|
| 63 | 63 | mkdir($path, 0777, true); |
| 64 | 64 | } |
| 65 | 65 | $policyTemplate = str_replace( |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | protected static function makeRestAPIController($name) |
| 43 | 43 | { |
| 44 | 44 | $lowername = strtolower($name); |
| 45 | - if (! file_exists($path = app_path('Http/Controllers/Admin/API/Restful'))) { |
|
| 45 | + if (!file_exists($path = app_path('Http/Controllers/Admin/API/Restful'))) { |
|
| 46 | 46 | mkdir($path, 0777, true); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | protected static function makeAPIController($name) |
| 69 | 69 | { |
| 70 | 70 | $lowername = strtolower($name); |
| 71 | - if (! file_exists($path = app_path('Http/Controllers/Admin/API'))) { |
|
| 71 | + if (!file_exists($path = app_path('Http/Controllers/Admin/API'))) { |
|
| 72 | 72 | mkdir($path, 0777, true); |
| 73 | 73 | } |
| 74 | 74 | $controllerTemplate = str_replace( |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | protected static function makeClientAPIResource($name) |
| 94 | 94 | { |
| 95 | - if (! file_exists($path = app_path("/Http/Resources/Client/{$name}"))) { |
|
| 95 | + if (!file_exists($path = app_path("/Http/Resources/Client/{$name}"))) { |
|
| 96 | 96 | mkdir($path, 0777, true); |
| 97 | 97 | } |
| 98 | 98 | // Making Collection |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | file_put_contents(app_path("/Http/Resources/Client/{$name}/{$name}Resource.php"), $clientResourceTemplate); |
| 129 | 129 | |
| 130 | 130 | // Making Controller |
| 131 | - if (! file_exists($path = app_path('Http/Controllers/API'))) { |
|
| 131 | + if (!file_exists($path = app_path('Http/Controllers/API'))) { |
|
| 132 | 132 | mkdir($path, 0777, true); |
| 133 | 133 | } |
| 134 | 134 | $controllerTemplate = str_replace( |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | */ |
| 43 | 43 | public function handle() |
| 44 | 44 | { |
| 45 | - if (! config('adminetic.migrate_with_dummy', false)) { |
|
| 45 | + if (!config('adminetic.migrate_with_dummy', false)) { |
|
| 46 | 46 | // Generating Roles |
| 47 | 47 | $roles = [ |
| 48 | 48 | [ |
@@ -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; |
@@ -73,48 +73,48 @@ discard block |
||
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | -if (! function_exists('getFavicon')) { |
|
| 76 | +if (!function_exists('getFavicon')) { |
|
| 77 | 77 | function getFavicon() |
| 78 | 78 | { |
| 79 | 79 | return setting('favicon') ? (asset('storage/'.setting('favicon'))) : 'adminetic/static/favicon.png'; |
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | -if (! function_exists('getLogo')) { |
|
| 82 | +if (!function_exists('getLogo')) { |
|
| 83 | 83 | function getLogo() |
| 84 | 84 | { |
| 85 | 85 | return setting('logo') ? (asset('storage/'.setting('logo'))) : 'adminetic/static/logo.png'; |
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | -if (! function_exists('getLogoBanner')) { |
|
| 89 | +if (!function_exists('getLogoBanner')) { |
|
| 90 | 90 | function getLogoBanner() |
| 91 | 91 | { |
| 92 | 92 | return setting('logo_banner') ? (asset('storage/'.setting('logo_banner'))) : 'adminetic/static/logo_banner.jpg'; |
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | -if (! function_exists('getLazyLoadImg')) { |
|
| 96 | +if (!function_exists('getLazyLoadImg')) { |
|
| 97 | 97 | function getLazyLoadImg() |
| 98 | 98 | { |
| 99 | 99 | return asset('website/assets/images/image-bg.svg'); |
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | -if (! function_exists('random_color_part')) { |
|
| 103 | +if (!function_exists('random_color_part')) { |
|
| 104 | 104 | function random_color_part() |
| 105 | 105 | { |
| 106 | 106 | return str_pad(dechex(mt_rand(0, 255)), 2, '0', STR_PAD_LEFT); |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | -if (! function_exists('random_color')) { |
|
| 110 | +if (!function_exists('random_color')) { |
|
| 111 | 111 | function random_color() |
| 112 | 112 | { |
| 113 | 113 | return random_color_part().random_color_part().random_color_part(); |
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | -if (! function_exists('setting')) { |
|
| 117 | +if (!function_exists('setting')) { |
|
| 118 | 118 | function setting($setting_name, $default = null) |
| 119 | 119 | { |
| 120 | 120 | $valid_setting_name = strtolower(str_replace(' ', '_', $setting_name)); |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | -if (! function_exists('preference')) { |
|
| 127 | +if (!function_exists('preference')) { |
|
| 128 | 128 | function preference($preference_name, bool $default = null) |
| 129 | 129 | { |
| 130 | 130 | $valid_preference_name = strtolower(str_replace(' ', '_', $preference_name)); |
@@ -138,11 +138,11 @@ discard block |
||
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | -if (! function_exists('getCondition')) { |
|
| 141 | +if (!function_exists('getCondition')) { |
|
| 142 | 142 | function getCondition($conditions) |
| 143 | 143 | { |
| 144 | 144 | $result = null; |
| 145 | - if (! isset($conditions)) { |
|
| 145 | + if (!isset($conditions)) { |
|
| 146 | 146 | return false; |
| 147 | 147 | } |
| 148 | 148 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | // Make Controller |
| 20 | 20 | protected static function makeController($name, $console) |
| 21 | 21 | { |
| 22 | - if (! file_exists($path = app_path('/Http/Controllers/Admin'))) { |
|
| 22 | + if (!file_exists($path = app_path('/Http/Controllers/Admin'))) { |
|
| 23 | 23 | mkdir($path, 0777, true); |
| 24 | 24 | } |
| 25 | 25 | $controllerTemplate = str_replace( |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | // Make Model |
| 44 | 44 | protected static function makeModel($name, $console) |
| 45 | 45 | { |
| 46 | - if (! file_exists($path = app_path('/Models/Admin'))) { |
|
| 46 | + if (!file_exists($path = app_path('/Models/Admin'))) { |
|
| 47 | 47 | mkdir($path, 0777, true); |
| 48 | 48 | } |
| 49 | 49 | $modelTemplate = str_replace( |
@@ -68,11 +68,11 @@ discard block |
||
| 68 | 68 | protected static function makeViews($name, $console) |
| 69 | 69 | { |
| 70 | 70 | $lowername = strtolower($name); |
| 71 | - if (! file_exists($path = resource_path('views/admin/'.$lowername))) { |
|
| 71 | + if (!file_exists($path = resource_path('views/admin/'.$lowername))) { |
|
| 72 | 72 | mkdir($path, 0777, true); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - if (! file_exists($path = resource_path('views/admin/layouts/modules/'.$lowername))) { |
|
| 75 | + if (!file_exists($path = resource_path('views/admin/layouts/modules/'.$lowername))) { |
|
| 76 | 76 | mkdir($path, 0777, true); |
| 77 | 77 | } |
| 78 | 78 | |