@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function saveMany(array $data) |
| 26 | 26 | { |
| 27 | - \DB::transaction(function () use ($data) { |
|
| 27 | + \DB::transaction(function() use ($data) { |
|
| 28 | 28 | foreach ($data as $value) { |
| 29 | 29 | $this->repo->save($value); |
| 30 | 30 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * Assign the permissions to the admin role. |
| 20 | 20 | */ |
| 21 | - \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['report'])->each(function ($permission) use ($adminRoleId) { |
|
| 21 | + \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['report'])->each(function($permission) use ($adminRoleId) { |
|
| 22 | 22 | \DB::table('permission_role')->insert( |
| 23 | 23 | [ |
| 24 | 24 | 'permission_id' => $permission->id, |
@@ -11,6 +11,6 @@ |
||
| 11 | 11 | | |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -Broadcast::channel('users.{id}', function ($user, $id) {
|
|
| 14 | +Broadcast::channel('users.{id}', function($user, $id) {
|
|
| 15 | 15 | return (int) $user->id === (int) $id; |
| 16 | 16 | }); |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | return \Response::json(['errors' => [$errors]], $exception->getStatusCode()); |
| 64 | 64 | } elseif ($exception instanceof \Illuminate\Validation\ValidationException) {
|
| 65 | 65 | return \Response::json(['errors' => $exception->errors()], 422); |
| 66 | - } elseif (! $exception instanceof \Symfony\Component\ErrorHandler\Error\FatalError) {
|
|
| 66 | + } elseif ( ! $exception instanceof \Symfony\Component\ErrorHandler\Error\FatalError) {
|
|
| 67 | 67 | return parent::render($request, $exception); |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | {
|
| 26 | 26 | $this->registerPolicies(); |
| 27 | 27 | |
| 28 | - Passport::routes(function ($router) {
|
|
| 28 | + Passport::routes(function($router) {
|
|
| 29 | 29 | $router->forAuthorization(); |
| 30 | 30 | $router->forAccessTokens(); |
| 31 | 31 | $router->forPersonalAccessTokens(); |
@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | $permission = $routeActions[1]; |
| 57 | 57 | |
| 58 | 58 | $this->auth->shouldUse('api'); |
| 59 | - if (! in_array($permission, $skipLoginCheck)) { |
|
| 60 | - $this->authMiddleware->handle($request, function ($request) use ($modelName, $skipPermissionCheck, $skipLoginCheck, $permission) { |
|
| 59 | + if ( ! in_array($permission, $skipLoginCheck)) { |
|
| 60 | + $this->authMiddleware->handle($request, function($request) use ($modelName, $skipPermissionCheck, $skipLoginCheck, $permission) { |
|
| 61 | 61 | $user = $this->auth->user(); |
| 62 | 62 | $isPasswordClient = $user->token()->client->password_client; |
| 63 | 63 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | if ($isPasswordClient && (in_array($permission, $skipPermissionCheck) || $this->userService->can($permission, $modelName))) { |
| 69 | - } elseif (! $isPasswordClient && $user->tokenCan($modelName.'-'.$permission)) { |
|
| 69 | + } elseif ( ! $isPasswordClient && $user->tokenCan($modelName.'-'.$permission)) { |
|
| 70 | 70 | } else { |
| 71 | 71 | \Errors::noPermissions(); |
| 72 | 72 | } |
@@ -28,27 +28,27 @@ |
||
| 28 | 28 | public function register() |
| 29 | 29 | { |
| 30 | 30 | //Bind Core Facade to the Service Container |
| 31 | - $this->app->singleton('Core', function () { |
|
| 31 | + $this->app->singleton('Core', function() { |
|
| 32 | 32 | return new \App\Modules\Core\Core; |
| 33 | 33 | }); |
| 34 | 34 | |
| 35 | 35 | //Bind Errors Facade to the Service Container |
| 36 | - $this->app->singleton('Errors', function () { |
|
| 36 | + $this->app->singleton('Errors', function() { |
|
| 37 | 37 | return new \App\Modules\Core\Utl\Errors; |
| 38 | 38 | }); |
| 39 | 39 | |
| 40 | 40 | //Bind CoreConfig Facade to the Service Container |
| 41 | - $this->app->singleton('CoreConfig', function () { |
|
| 41 | + $this->app->singleton('CoreConfig', function() { |
|
| 42 | 42 | return new \App\Modules\Core\Utl\CoreConfig; |
| 43 | 43 | }); |
| 44 | 44 | |
| 45 | 45 | //Bind Media Facade to the Service Container |
| 46 | - $this->app->singleton('Media', function () { |
|
| 46 | + $this->app->singleton('Media', function() { |
|
| 47 | 47 | return new \App\Modules\Core\Utl\Media; |
| 48 | 48 | }); |
| 49 | 49 | |
| 50 | 50 | //Bind ApiConsumer Facade to the Service Container |
| 51 | - $this->app->singleton('ApiConsumer', function () { |
|
| 51 | + $this->app->singleton('ApiConsumer', function() { |
|
| 52 | 52 | $app = app(); |
| 53 | 53 | return new \App\Modules\Core\Utl\ApiConsumer($app, $app['request'], $app['router']); |
| 54 | 54 | }); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $this->container['slug'] = Str::slug($this->argument('slug')); |
| 90 | 90 | $this->container['name'] = Str::studly($this->container['slug']); |
| 91 | 91 | $this->container['version'] = '1.0'; |
| 92 | - $this->container['description'] = 'This is the description for the ' . $this->container['name'] . ' module.'; |
|
| 92 | + $this->container['description'] = 'This is the description for the '.$this->container['name'].' module.'; |
|
| 93 | 93 | $this->container['location'] = config('modules.default_location'); |
| 94 | 94 | $this->container['provider'] = config("modules.locations.{$this->container['location']}.provider"); |
| 95 | 95 | $this->container['basename'] = Str::studly($this->container['slug']); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | $progress->finish(); |
| 124 | 124 | |
| 125 | - event($this->container['slug'] . '.module.made'); |
|
| 125 | + event($this->container['slug'].'.module.made'); |
|
| 126 | 126 | |
| 127 | 127 | $this->info("\nModule generated successfully."); |
| 128 | 128 | } |
@@ -137,18 +137,18 @@ discard block |
||
| 137 | 137 | $manifest = config("modules.locations.$location.manifest") ?: 'module.json'; |
| 138 | 138 | $provider = config("modules.locations.$location.provider") ?: 'ModuleServiceProvider'; |
| 139 | 139 | |
| 140 | - if (!$this->files->isDirectory($root)) { |
|
| 140 | + if ( ! $this->files->isDirectory($root)) { |
|
| 141 | 141 | $this->files->makeDirectory($root); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | $directory = module_path(null, $this->container['basename'], $location); |
| 145 | - $source = __DIR__ . '/Stubs/Module'; |
|
| 145 | + $source = __DIR__.'/Stubs/Module'; |
|
| 146 | 146 | |
| 147 | 147 | $this->files->makeDirectory($directory); |
| 148 | 148 | |
| 149 | 149 | $sourceFiles = $this->files->allFiles($source, true); |
| 150 | 150 | |
| 151 | - if (!empty($this->mapping)) { |
|
| 151 | + if ( ! empty($this->mapping)) { |
|
| 152 | 152 | $search = array_keys($this->mapping); |
| 153 | 153 | $replace = array_values($this->mapping); |
| 154 | 154 | } |
@@ -157,11 +157,11 @@ discard block |
||
| 157 | 157 | $contents = $this->replacePlaceholders($file->getContents()); |
| 158 | 158 | $subPath = $file->getRelativePathname(); |
| 159 | 159 | |
| 160 | - if (!empty($this->mapping)) { |
|
| 160 | + if ( ! empty($this->mapping)) { |
|
| 161 | 161 | $subPath = str_replace($search, $replace, $subPath); |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | - $filePath = $directory . '/' . $subPath; |
|
| 164 | + $filePath = $directory.'/'.$subPath; |
|
| 165 | 165 | |
| 166 | 166 | // if the file is module.json, replace it with the custom manifest file name |
| 167 | 167 | if ($file->getFilename() === 'module.json' && $manifest) { |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | $dir = dirname($filePath); |
| 178 | 178 | |
| 179 | - if (! $this->files->isDirectory($dir)) { |
|
| 179 | + if ( ! $this->files->isDirectory($dir)) { |
|
| 180 | 180 | $this->files->makeDirectory($dir, 0755, true); |
| 181 | 181 | } |
| 182 | 182 | |
@@ -209,20 +209,20 @@ discard block |
||
| 209 | 209 | ]; |
| 210 | 210 | |
| 211 | 211 | $replace = [ |
| 212 | - ucfirst($modelNameSingular) . 'Factory', |
|
| 212 | + ucfirst($modelNameSingular).'Factory', |
|
| 213 | 213 | $modelNameSingular, |
| 214 | 214 | $this->container['slug'], |
| 215 | 215 | ucfirst($modelName), |
| 216 | 216 | ucfirst($modelNameSingular), |
| 217 | - ucfirst($modelName) . 'DatabaseSeeder', |
|
| 218 | - ucfirst($modelName) . 'TableSeeder', |
|
| 219 | - ucfirst($modelNameSingular) . 'Controller', |
|
| 220 | - ucfirst($modelNameSingular) . 'Service', |
|
| 221 | - ucfirst($modelNameSingular) . 'Repository', |
|
| 222 | - 'Insert' . ucfirst($modelNameSingular), |
|
| 223 | - 'Update' . ucfirst($modelNameSingular), |
|
| 217 | + ucfirst($modelName).'DatabaseSeeder', |
|
| 218 | + ucfirst($modelName).'TableSeeder', |
|
| 219 | + ucfirst($modelNameSingular).'Controller', |
|
| 220 | + ucfirst($modelNameSingular).'Service', |
|
| 221 | + ucfirst($modelNameSingular).'Repository', |
|
| 222 | + 'Insert'.ucfirst($modelNameSingular), |
|
| 223 | + 'Update'.ucfirst($modelNameSingular), |
|
| 224 | 224 | ucfirst($modelNameSingular), |
| 225 | - ucfirst($modelNameSingular) . 'Observer', |
|
| 225 | + ucfirst($modelNameSingular).'Observer', |
|
| 226 | 226 | $modelName, |
| 227 | 227 | $modelName, |
| 228 | 228 | ]; |
@@ -244,6 +244,6 @@ discard block |
||
| 244 | 244 | protected function generateMigration() |
| 245 | 245 | { |
| 246 | 246 | $modelName = $this->container['slug']; |
| 247 | - return $this->callSilent('make:module:migration', ['slug' => $modelName, 'name' => 'create_' . $modelName . '_table']); |
|
| 247 | + return $this->callSilent('make:module:migration', ['slug' => $modelName, 'name' => 'create_'.$modelName.'_table']); |
|
| 248 | 248 | } |
| 249 | 249 | } |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | if ($this->cacheConfig && $this->cacheConfig == 'cache') { |
| 75 | 75 | $page = \Request::get('page') !== null ? \Request::get('page') : '1'; |
| 76 | 76 | $cacheKey = $name.$page.\Session::get('locale').serialize($arguments); |
| 77 | - return $this->cache->tags([$this->cacheTag])->rememberForever($cacheKey, function () use ($arguments, $name) { |
|
| 77 | + return $this->cache->tags([$this->cacheTag])->rememberForever($cacheKey, function() use ($arguments, $name) { |
|
| 78 | 78 | return call_user_func_array([$this->repo, $name], $arguments); |
| 79 | 79 | }); |
| 80 | 80 | } elseif ($this->cacheConfig && $this->cacheConfig == 'clear') { |