@@ -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 | }); |
@@ -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 | } |
@@ -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') { |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | |
| 50 | 50 | $response = \ApiConsumer::post('/oauth/token', $data); |
| 51 | 51 | |
| 52 | - if (! $response->isSuccessful()) { |
|
| 52 | + if ( ! $response->isSuccessful()) { |
|
| 53 | 53 | if ($grantType == 'refresh_token') { |
| 54 | 54 | \Errors::invalidRefreshToken(); |
| 55 | 55 | } |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | public function updated($model) |
| 37 | 37 | { |
| 38 | 38 | if ($model->isDirty('blocked') && $model->blocked) { |
| 39 | - $model->tokens()->each(function ($token) { |
|
| 39 | + $model->tokens()->each(function($token) { |
|
| 40 | 40 | \Core::oauthClients()->revokeAccessToken($token); |
| 41 | 41 | }); |
| 42 | 42 | } |
@@ -43,9 +43,9 @@ |
||
| 43 | 43 | /** |
| 44 | 44 | * Check report existance and permission. |
| 45 | 45 | */ |
| 46 | - if (! $report) { |
|
| 46 | + if ( ! $report) { |
|
| 47 | 47 | \Errors::notFound('report'); |
| 48 | - } elseif (! $skipPermission && ! $this->userService->can($report->view_name, 'report')) { |
|
| 48 | + } elseif ( ! $skipPermission && ! $this->userService->can($report->view_name, 'report')) { |
|
| 49 | 49 | \Errors::noPermissions(); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $this->container['slug'] = Str::slug($this->argument('slug')); |
| 91 | 91 | $this->container['name'] = Str::studly($this->container['slug']); |
| 92 | 92 | $this->container['version'] = '1.0'; |
| 93 | - $this->container['description'] = 'This is the description for the ' . $this->container['name'] . ' module.'; |
|
| 93 | + $this->container['description'] = 'This is the description for the '.$this->container['name'].' module.'; |
|
| 94 | 94 | $this->container['location'] = config('modules.default_location'); |
| 95 | 95 | $this->container['provider'] = config("modules.locations.{$this->container['location']}.provider"); |
| 96 | 96 | $this->container['basename'] = Str::studly($this->container['slug']); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | $progress->finish(); |
| 125 | 125 | |
| 126 | - event($this->container['slug'] . '.module.made'); |
|
| 126 | + event($this->container['slug'].'.module.made'); |
|
| 127 | 127 | |
| 128 | 128 | $this->info("\nModule generated successfully."); |
| 129 | 129 | } |
@@ -138,18 +138,18 @@ discard block |
||
| 138 | 138 | $manifest = config("modules.locations.$location.manifest") ?: 'module.json'; |
| 139 | 139 | $provider = config("modules.locations.$location.provider") ?: 'ModuleServiceProvider'; |
| 140 | 140 | |
| 141 | - if (!$this->files->isDirectory($root)) { |
|
| 141 | + if ( ! $this->files->isDirectory($root)) { |
|
| 142 | 142 | $this->files->makeDirectory($root); |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | $directory = module_path(null, $this->container['basename'], $location); |
| 146 | - $source = __DIR__ . '/Stubs/Module'; |
|
| 146 | + $source = __DIR__.'/Stubs/Module'; |
|
| 147 | 147 | |
| 148 | 148 | $this->files->makeDirectory($directory); |
| 149 | 149 | |
| 150 | 150 | $sourceFiles = $this->files->allFiles($source, true); |
| 151 | 151 | |
| 152 | - if (!empty($this->mapping)) { |
|
| 152 | + if ( ! empty($this->mapping)) { |
|
| 153 | 153 | $search = array_keys($this->mapping); |
| 154 | 154 | $replace = array_values($this->mapping); |
| 155 | 155 | } |
@@ -158,11 +158,11 @@ discard block |
||
| 158 | 158 | $contents = $this->replacePlaceholders($file->getContents()); |
| 159 | 159 | $subPath = $file->getRelativePathname(); |
| 160 | 160 | |
| 161 | - if (!empty($this->mapping)) { |
|
| 161 | + if ( ! empty($this->mapping)) { |
|
| 162 | 162 | $subPath = str_replace($search, $replace, $subPath); |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - $filePath = $directory . '/' . $subPath; |
|
| 165 | + $filePath = $directory.'/'.$subPath; |
|
| 166 | 166 | |
| 167 | 167 | // if the file is module.json, replace it with the custom manifest file name |
| 168 | 168 | if ($file->getFilename() === 'module.json' && $manifest) { |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | |
| 178 | 178 | $dir = dirname($filePath); |
| 179 | 179 | |
| 180 | - if (! $this->files->isDirectory($dir)) { |
|
| 180 | + if ( ! $this->files->isDirectory($dir)) { |
|
| 181 | 181 | $this->files->makeDirectory($dir, 0755, true); |
| 182 | 182 | } |
| 183 | 183 | |
@@ -211,21 +211,21 @@ discard block |
||
| 211 | 211 | ]; |
| 212 | 212 | |
| 213 | 213 | $replace = [ |
| 214 | - ucfirst($modelNameSingular) . 'Factory', |
|
| 214 | + ucfirst($modelNameSingular).'Factory', |
|
| 215 | 215 | $modelNameSingular, |
| 216 | 216 | $this->container['slug'], |
| 217 | 217 | ucfirst($modelName), |
| 218 | 218 | ucfirst($modelNameSingular), |
| 219 | - ucfirst($modelName) . 'DatabaseSeeder', |
|
| 220 | - ucfirst($modelName) . 'TableSeeder', |
|
| 221 | - ucfirst($modelNameSingular) . 'Controller', |
|
| 222 | - ucfirst($modelNameSingular) . 'Service', |
|
| 223 | - ucfirst($modelNameSingular) . 'Repository', |
|
| 224 | - ucfirst($modelName) . 'Errors', |
|
| 225 | - 'Insert' . ucfirst($modelNameSingular), |
|
| 226 | - 'Update' . ucfirst($modelNameSingular), |
|
| 219 | + ucfirst($modelName).'DatabaseSeeder', |
|
| 220 | + ucfirst($modelName).'TableSeeder', |
|
| 221 | + ucfirst($modelNameSingular).'Controller', |
|
| 222 | + ucfirst($modelNameSingular).'Service', |
|
| 223 | + ucfirst($modelNameSingular).'Repository', |
|
| 224 | + ucfirst($modelName).'Errors', |
|
| 225 | + 'Insert'.ucfirst($modelNameSingular), |
|
| 226 | + 'Update'.ucfirst($modelNameSingular), |
|
| 227 | 227 | ucfirst($modelNameSingular), |
| 228 | - ucfirst($modelNameSingular) . 'Observer', |
|
| 228 | + ucfirst($modelNameSingular).'Observer', |
|
| 229 | 229 | $modelName, |
| 230 | 230 | $modelName, |
| 231 | 231 | ]; |
@@ -247,6 +247,6 @@ discard block |
||
| 247 | 247 | protected function generateMigration() |
| 248 | 248 | { |
| 249 | 249 | $modelName = $this->container['slug']; |
| 250 | - return $this->callSilent('make:module:migration', ['slug' => $modelName, 'name' => 'create_' . $modelName . '_table']); |
|
| 250 | + return $this->callSilent('make:module:migration', ['slug' => $modelName, 'name' => 'create_'.$modelName.'_table']); |
|
| 251 | 251 | } |
| 252 | 252 | } |