@@ -15,7 +15,7 @@ |
||
| 15 | 15 | public function indexPreference() |
| 16 | 16 | { |
| 17 | 17 | $preferences = config('coderz.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(); |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | public function userIndex() |
| 19 | 19 | { |
| 20 | 20 | $users = config('coderz.caching', true) |
| 21 | - ? (Cache::has('users') ? Cache::get('users') : Cache::rememberForever('users', function () { |
|
| 21 | + ? (Cache::has('users') ? Cache::get('users') : Cache::rememberForever('users', function() { |
|
| 22 | 22 | return User::with('roles', 'profile')->get(); |
| 23 | 23 | })) |
| 24 | 24 | : User::with('roles', 'profile')->get(); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | private function addAdminServiceProvider() |
| 62 | 62 | { |
| 63 | - $adminServiceProviderTemplate = file_get_contents(__DIR__ . '/../../Console/Commands/AdminStubs/AdminServiceProvider.stub'); |
|
| 63 | + $adminServiceProviderTemplate = file_get_contents(__DIR__.'/../../Console/Commands/AdminStubs/AdminServiceProvider.stub'); |
|
| 64 | 64 | $adminServiceProviderfile = app_path('Providers/AdminServiceProvider.php'); |
| 65 | 65 | file_put_contents($adminServiceProviderfile, $adminServiceProviderTemplate); |
| 66 | 66 | if (file_exists($adminServiceProviderfile)) { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | private function addMyMenu() |
| 74 | 74 | { |
| 75 | - $modelTemplate = file_get_contents(__DIR__ . '/../../Console/Commands/AdminStubs/MyMenu.stub'); |
|
| 75 | + $modelTemplate = file_get_contents(__DIR__.'/../../Console/Commands/AdminStubs/MyMenu.stub'); |
|
| 76 | 76 | |
| 77 | 77 | if (!file_exists($path = app_path('Services'))) { |
| 78 | 78 | mkdir($path, 0777, true); |
@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | private function addMyDashboard() |
| 91 | 91 | { |
| 92 | - $myDashboardTemplate = file_get_contents(__DIR__ . '/../../Console/Commands/AdminStubs/MyDashboard.stub'); |
|
| 93 | - $myDashboardIndexTemplate = file_get_contents(__DIR__ . '/../../Console/Commands/AdminStubs/DashboardIndex.stub'); |
|
| 92 | + $myDashboardTemplate = file_get_contents(__DIR__.'/../../Console/Commands/AdminStubs/MyDashboard.stub'); |
|
| 93 | + $myDashboardIndexTemplate = file_get_contents(__DIR__.'/../../Console/Commands/AdminStubs/DashboardIndex.stub'); |
|
| 94 | 94 | |
| 95 | 95 | if (!file_exists($path = app_path('Services'))) { |
| 96 | 96 | mkdir($path, 0777, true); |
@@ -127,6 +127,6 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | protected static function getStub($type) |
| 129 | 129 | { |
| 130 | - return file_get_contents(__DIR__ . "/../../Console/Commands/AdminStubs/$type.stub"); |
|
| 130 | + return file_get_contents(__DIR__."/../../Console/Commands/AdminStubs/$type.stub"); |
|
| 131 | 131 | } |
| 132 | 132 | } |
@@ -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 | |
@@ -171,25 +171,25 @@ discard block |
||
| 171 | 171 | // Make Other neccesary CRUD files |
| 172 | 172 | protected static function makeOthers($name, $console) |
| 173 | 173 | { |
| 174 | - Artisan::call('make:migration create_' . strtolower(Str::plural($name)) . '_table --create=' . strtolower(Str::plural($name))); |
|
| 175 | - $console->info('Migration file created named create_' . strtolower(Str::plural($name)) . '_table ... ✅'); |
|
| 174 | + Artisan::call('make:migration create_'.strtolower(Str::plural($name)).'_table --create='.strtolower(Str::plural($name))); |
|
| 175 | + $console->info('Migration file created named create_'.strtolower(Str::plural($name)).'_table ... ✅'); |
|
| 176 | 176 | |
| 177 | - Artisan::call('make:seeder ' . $name . 'Seeder'); |
|
| 177 | + Artisan::call('make:seeder '.$name.'Seeder'); |
|
| 178 | 178 | $console->info('Seeder file created ... ✅'); |
| 179 | 179 | |
| 180 | - Artisan::call('make:repo ' . $name); |
|
| 180 | + Artisan::call('make:repo '.$name); |
|
| 181 | 181 | $console->info('Repository and Interface created ... ✅'); |
| 182 | 182 | |
| 183 | - Artisan::call('make:request ' . $name . 'Request'); |
|
| 183 | + Artisan::call('make:request '.$name.'Request'); |
|
| 184 | 184 | $console->info('Request file created ... ✅'); |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | protected static function fileMadeSuccess($console, $file, $type) |
| 188 | 188 | { |
| 189 | 189 | if (file_exists($file)) { |
| 190 | - $console->info($type . ' created successfully ... ✅'); |
|
| 190 | + $console->info($type.' created successfully ... ✅'); |
|
| 191 | 191 | } else { |
| 192 | - $console->error('Failed to create ' . $type . ' ...'); |
|
| 192 | + $console->error('Failed to create '.$type.' ...'); |
|
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | 195 | } |
@@ -126,26 +126,26 @@ discard block |
||
| 126 | 126 | { |
| 127 | 127 | // Publish Config File |
| 128 | 128 | $this->publishes([ |
| 129 | - __DIR__ . '/../../config/adminetic.php' => config_path('adminetic.php'), |
|
| 129 | + __DIR__.'/../../config/adminetic.php' => config_path('adminetic.php'), |
|
| 130 | 130 | ], 'adminetic-config'); |
| 131 | 131 | // Publish View Files |
| 132 | 132 | $this->publishes([ |
| 133 | - __DIR__ . '/../../resources/views' => resource_path('views/vendor/adminetic'), |
|
| 133 | + __DIR__.'/../../resources/views' => resource_path('views/vendor/adminetic'), |
|
| 134 | 134 | ], 'adminetic-views'); |
| 135 | 135 | // Publish Migration Files |
| 136 | 136 | $this->publishes([ |
| 137 | - __DIR__ . '/../../database/migrations' => database_path('migrations'), |
|
| 137 | + __DIR__.'/../../database/migrations' => database_path('migrations'), |
|
| 138 | 138 | ], 'adminetic-migrations'); |
| 139 | 139 | // Publish Database Seeds |
| 140 | 140 | $this->publishes([ |
| 141 | - __DIR__ . '/../../database/seeders' => database_path('seeders'), |
|
| 141 | + __DIR__.'/../../database/seeders' => database_path('seeders'), |
|
| 142 | 142 | ], 'adminetic-seeders'); |
| 143 | 143 | $this->publishes([ |
| 144 | - __DIR__ . '/../../payload/assets' => public_path('adminetic/assets'), |
|
| 144 | + __DIR__.'/../../payload/assets' => public_path('adminetic/assets'), |
|
| 145 | 145 | ], 'adminetic-assets-files'); |
| 146 | 146 | // Publish Static Files |
| 147 | 147 | $this->publishes([ |
| 148 | - __DIR__ . '/../../payload/static' => public_path('adminetic/static'), |
|
| 148 | + __DIR__.'/../../payload/static' => public_path('adminetic/static'), |
|
| 149 | 149 | ], 'adminetic-static-files'); |
| 150 | 150 | } |
| 151 | 151 | |
@@ -156,8 +156,8 @@ discard block |
||
| 156 | 156 | */ |
| 157 | 157 | protected function registerResource() |
| 158 | 158 | { |
| 159 | - $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations'); // Loading Migration Files |
|
| 160 | - $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'adminetic'); // Loading Views Files |
|
| 159 | + $this->loadMigrationsFrom(__DIR__.'/../../database/migrations'); // Loading Migration Files |
|
| 160 | + $this->loadViewsFrom(__DIR__.'/../../resources/views', 'adminetic'); // Loading Views Files |
|
| 161 | 161 | $this->registerRoutes(); |
| 162 | 162 | } |
| 163 | 163 | |
@@ -168,8 +168,8 @@ discard block |
||
| 168 | 168 | */ |
| 169 | 169 | protected function registerRoutes() |
| 170 | 170 | { |
| 171 | - Route::group($this->routeConfiguration(), function () { |
|
| 172 | - $this->loadRoutesFrom(__DIR__ . '/../../routes/web.php'); |
|
| 171 | + Route::group($this->routeConfiguration(), function() { |
|
| 172 | + $this->loadRoutesFrom(__DIR__.'/../../routes/web.php'); |
|
| 173 | 173 | }); |
| 174 | 174 | } |
| 175 | 175 | |
@@ -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 | } |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | */ |
| 304 | 304 | protected function getFacades() |
| 305 | 305 | { |
| 306 | - $this->app->bind('adminetic', function ($app) { |
|
| 306 | + $this->app->bind('adminetic', function($app) { |
|
| 307 | 307 | return new Adminetic(); |
| 308 | 308 | }); |
| 309 | 309 | } |