@@ -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 @@ |
||
| 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 | [ |
@@ -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 | |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | */ |
| 169 | 169 | protected function registerRoutes() |
| 170 | 170 | { |
| 171 | - Route::group($this->routeConfiguration(), function () { |
|
| 171 | + Route::group($this->routeConfiguration(), function() { |
|
| 172 | 172 | $this->loadRoutesFrom(__DIR__.'/../../routes/web.php'); |
| 173 | 173 | }); |
| 174 | 174 | } |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | */ |
| 213 | 213 | protected function directives() |
| 214 | 214 | { |
| 215 | - Blade::if('hasRole', function ($roles) { |
|
| 215 | + Blade::if ('hasRole', function($roles) { |
|
| 216 | 216 | $hasAccess = false; |
| 217 | 217 | $roles_array = explode('|', $roles); |
| 218 | 218 | foreach ($roles_array as $role) { |
@@ -221,10 +221,10 @@ discard block |
||
| 221 | 221 | |
| 222 | 222 | return $hasAccess; |
| 223 | 223 | }); |
| 224 | - Blade::if('preference', function ($preference_name, $default_value) { |
|
| 224 | + Blade::if ('preference', function($preference_name, $default_value) { |
|
| 225 | 225 | return preference($preference_name, $default_value); |
| 226 | 226 | }); |
| 227 | - Blade::directive('setting', function ($setting_name) { |
|
| 227 | + Blade::directive('setting', function($setting_name) { |
|
| 228 | 228 | return "<?php echo setting($setting_name) ?>"; |
| 229 | 229 | }); |
| 230 | 230 | } |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | */ |
| 302 | 302 | protected function getFacades() |
| 303 | 303 | { |
| 304 | - $this->app->bind('adminetic', function ($app) { |
|
| 304 | + $this->app->bind('adminetic', function($app) { |
|
| 305 | 305 | return new Adminetic(); |
| 306 | 306 | }); |
| 307 | 307 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | { |
| 81 | 81 | $modelTemplate = file_get_contents(__DIR__.'/../../Console/Commands/AdminStubs/MyMenu.stub'); |
| 82 | 82 | |
| 83 | - if (! file_exists($path = app_path('Services'))) { |
|
| 83 | + if (!file_exists($path = app_path('Services'))) { |
|
| 84 | 84 | mkdir($path, 0777, true); |
| 85 | 85 | } |
| 86 | 86 | |
@@ -98,13 +98,13 @@ discard block |
||
| 98 | 98 | $myDashboardTemplate = file_get_contents(__DIR__.'/../../Console/Commands/AdminStubs/MyDashboard.stub'); |
| 99 | 99 | $myDashboardIndexTemplate = file_get_contents(__DIR__.'/../../Console/Commands/AdminStubs/DashboardIndex.stub'); |
| 100 | 100 | |
| 101 | - if (! file_exists($path = app_path('Services'))) { |
|
| 101 | + if (!file_exists($path = app_path('Services'))) { |
|
| 102 | 102 | mkdir($path, 0777, true); |
| 103 | 103 | } |
| 104 | - if (! file_exists($path = resource_path('views/admin/dashboard'))) { |
|
| 104 | + if (!file_exists($path = resource_path('views/admin/dashboard'))) { |
|
| 105 | 105 | mkdir($path, 0777, true); |
| 106 | 106 | } |
| 107 | - if (! file_exists($path = resource_path('views/admin/layouts/modules/dashboard'))) { |
|
| 107 | + if (!file_exists($path = resource_path('views/admin/layouts/modules/dashboard'))) { |
|
| 108 | 108 | mkdir($path, 0777, true); |
| 109 | 109 | } |
| 110 | 110 | $myDashboardIndexfile = resource_path('views/admin/dashboard/index.blade.php'); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | { |
| 136 | 136 | $myHeaderTemplate = file_get_contents(__DIR__.'/../../Console/Commands/AdminStubs/HeaderView.stub'); |
| 137 | 137 | |
| 138 | - if (! file_exists($path = resource_path('views/admin/layouts/components'))) { |
|
| 138 | + if (!file_exists($path = resource_path('views/admin/layouts/components'))) { |
|
| 139 | 139 | mkdir($path, 0777, true); |
| 140 | 140 | } |
| 141 | 141 | |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | { |
| 153 | 153 | $myFooterTemplate = file_get_contents(__DIR__.'/../../Console/Commands/AdminStubs/FooterView.stub'); |
| 154 | 154 | |
| 155 | - if (! file_exists($path = resource_path('views/admin/layouts/components'))) { |
|
| 155 | + if (!file_exists($path = resource_path('views/admin/layouts/components'))) { |
|
| 156 | 156 | mkdir($path, 0777, true); |
| 157 | 157 | } |
| 158 | 158 | |
@@ -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(); |
@@ -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 | ]); |
@@ -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; |