@@ -76,7 +76,7 @@ |
||
76 | 76 | if ($this->cacheConfig && $this->cacheConfig == 'cache') { |
77 | 77 | $page = \Request::get('page') !== null ? \Request::get('page') : '1'; |
78 | 78 | $cacheKey = $name.$page.\Session::get('locale').serialize($arguments); |
79 | - return $this->cache->tags([$this->cacheTag])->rememberForever($cacheKey, function () use ($arguments, $name) { |
|
79 | + return $this->cache->tags([$this->cacheTag])->rememberForever($cacheKey, function() use ($arguments, $name) { |
|
80 | 80 | return call_user_func_array([$this->service, $name], $arguments); |
81 | 81 | }); |
82 | 82 | } elseif ($this->cacheConfig) { |
@@ -26,11 +26,11 @@ |
||
26 | 26 | */ |
27 | 27 | public function uploadImageBas64($image, $dir) |
28 | 28 | { |
29 | - if (! strlen($image)) { |
|
29 | + if ( ! strlen($image)) { |
|
30 | 30 | return null; |
31 | 31 | } |
32 | 32 | |
33 | - if(filter_var($image, FILTER_VALIDATE_URL)) { |
|
33 | + if (filter_var($image, FILTER_VALIDATE_URL)) { |
|
34 | 34 | return $image; |
35 | 35 | } |
36 | 36 |
@@ -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 | |
@@ -210,20 +210,20 @@ discard block |
||
210 | 210 | ]; |
211 | 211 | |
212 | 212 | $replace = [ |
213 | - ucfirst($modelNameSingular) . 'Factory', |
|
213 | + ucfirst($modelNameSingular).'Factory', |
|
214 | 214 | $modelNameSingular, |
215 | 215 | $this->container['slug'], |
216 | 216 | ucfirst($modelName), |
217 | 217 | ucfirst($modelNameSingular), |
218 | - ucfirst($modelName) . 'DatabaseSeeder', |
|
219 | - ucfirst($modelName) . 'TableSeeder', |
|
220 | - ucfirst($modelNameSingular) . 'Controller', |
|
221 | - ucfirst($modelNameSingular) . 'Service', |
|
222 | - ucfirst($modelNameSingular) . 'Repository', |
|
223 | - ucfirst($modelName) . 'Errors', |
|
224 | - 'Store' . ucfirst($modelNameSingular), |
|
218 | + ucfirst($modelName).'DatabaseSeeder', |
|
219 | + ucfirst($modelName).'TableSeeder', |
|
220 | + ucfirst($modelNameSingular).'Controller', |
|
221 | + ucfirst($modelNameSingular).'Service', |
|
222 | + ucfirst($modelNameSingular).'Repository', |
|
223 | + ucfirst($modelName).'Errors', |
|
224 | + 'Store'.ucfirst($modelNameSingular), |
|
225 | 225 | ucfirst($modelNameSingular), |
226 | - ucfirst($modelNameSingular) . 'Observer', |
|
226 | + ucfirst($modelNameSingular).'Observer', |
|
227 | 227 | \Str::snake($modelName), |
228 | 228 | $modelName, |
229 | 229 | ]; |
@@ -247,6 +247,6 @@ discard block |
||
247 | 247 | $modelName = $this->container['slug']; |
248 | 248 | $migrationName = \Str::camel($modelName); |
249 | 249 | $migrationName = \Str::snake($migrationName); |
250 | - return $this->callSilent('make:module:migration', ['slug' => $modelName, 'name' => 'create_' . $migrationName . '_table']); |
|
250 | + return $this->callSilent('make:module:migration', ['slug' => $modelName, 'name' => 'create_'.$migrationName.'_table']); |
|
251 | 251 | } |
252 | 252 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | protected function getRoutes() |
94 | 94 | { |
95 | - return collect(\Route::getRoutes())->map(function ($route) { |
|
95 | + return collect(\Route::getRoutes())->map(function($route) { |
|
96 | 96 | if (strpos($route->uri(), 'api/') !== false) { |
97 | 97 | return [ |
98 | 98 | 'method' => $route->methods()[0], |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | ]; |
124 | 124 | |
125 | 125 | |
126 | - if (! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) { |
|
126 | + if ( ! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) { |
|
127 | 127 | $route['headers']['Authorization'] = 'Bearer {token}'; |
128 | 128 | } |
129 | 129 | } |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | if ($className) { |
182 | 182 | $reflectionClass = new \ReflectionClass($className); |
183 | 183 | } elseif (in_array($reflectionMethod->getName(), ['store', 'update'])) { |
184 | - $className = 'App\\Modules\\' . ucfirst($module) . '\\Http\\Requests\\Store' . ucfirst($modelName); |
|
184 | + $className = 'App\\Modules\\'.ucfirst($module).'\\Http\\Requests\\Store'.ucfirst($modelName); |
|
185 | 185 | $reflectionClass = new \ReflectionClass($className); |
186 | 186 | } |
187 | 187 | |
@@ -208,8 +208,8 @@ discard block |
||
208 | 208 | { |
209 | 209 | $errors = []; |
210 | 210 | foreach (\Module::all() as $module) { |
211 | - $nameSpace = 'App\\Modules\\' . $module['basename']; |
|
212 | - $class = $nameSpace . '\\Errors\\' . $module['basename'] . 'Errors'; |
|
211 | + $nameSpace = 'App\\Modules\\'.$module['basename']; |
|
212 | + $class = $nameSpace.'\\Errors\\'.$module['basename'].'Errors'; |
|
213 | 213 | $reflectionClass = new \ReflectionClass($class); |
214 | 214 | foreach ($reflectionClass->getMethods() as $method) { |
215 | 215 | $methodName = $method->name; |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | { |
258 | 258 | if ($modelName && ! Arr::has($docData['models'], $modelName)) { |
259 | 259 | $repo = call_user_func_array("\Core::{$modelName}", []); |
260 | - if (! $repo) { |
|
260 | + if ( ! $repo) { |
|
261 | 261 | return; |
262 | 262 | } |
263 | 263 | |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | $body = $this->getMethodBody($reflectionMethod); |
276 | 276 | foreach ($relationMethods as $relationMethod) { |
277 | 277 | $relation = $reflectionMethod->getName(); |
278 | - if (strpos($body, '$this->' . $relationMethod) && $relation !== 'morphedByMany') { |
|
278 | + if (strpos($body, '$this->'.$relationMethod) && $relation !== 'morphedByMany') { |
|
279 | 279 | $relations[] = $relation; |
280 | 280 | break; |
281 | 281 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | { |
33 | 33 | $this->call('passport:keys', ['--force' => $this->option('force'), '--length' => $this->option('length')]); |
34 | 34 | $oauthClient = \Core::oauthCLients()->first(['password_client' => 1]); |
35 | - if (! $oauthClient) { |
|
35 | + if ( ! $oauthClient) { |
|
36 | 36 | $oauthClient = $client->createPasswordGrantClient( |
37 | 37 | null, |
38 | 38 | config('app.name'), |
@@ -25,7 +25,7 @@ |
||
25 | 25 | { |
26 | 26 | return [ |
27 | 27 | 'name' => 'nullable|string', |
28 | - 'email' => 'required|email|unique:users,email,' . $this->route('id'), |
|
28 | + 'email' => 'required|email|unique:users,email,'.$this->route('id'), |
|
29 | 29 | 'password' => 'nullable|min:6' |
30 | 30 | ]; |
31 | 31 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | Role::updateOrInsert([ |
22 | 22 | 'name' => 'Admin', |
23 | - ],[ |
|
23 | + ], [ |
|
24 | 24 | 'created_at' => \DB::raw('NOW()'), |
25 | 25 | 'updated_at' => \DB::raw('NOW()') |
26 | 26 | ]); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | AclUser::updateOrInsert([ |
32 | 32 | 'email' => '[email protected]', |
33 | - ],[ |
|
33 | + ], [ |
|
34 | 34 | 'name' => 'Admin', |
35 | 35 | 'password' => \Hash::make('123456'), |
36 | 36 | 'confirmed' => 1, |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $permissions = []; |
68 | 68 | $user = $this->repo->find(\Auth::id(), $relations); |
69 | 69 | foreach ($user->roles as $role) { |
70 | - $role->permissions->each(function ($permission) use (&$permissions) { |
|
70 | + $role->permissions->each(function($permission) use (&$permissions) { |
|
71 | 71 | $permissions[$permission->repo][$permission->id] = $permission->name; |
72 | 72 | }); |
73 | 73 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | public function assignRoles($userId, $roleIds) |
131 | 131 | { |
132 | 132 | $user = false; |
133 | - \DB::transaction(function () use ($userId, $roleIds, &$user) { |
|
133 | + \DB::transaction(function() use ($userId, $roleIds, &$user) { |
|
134 | 134 | $user = $this->repo->find($userId); |
135 | 135 | $this->repo->detachRoles($user); |
136 | 136 | $this->repo->attachRoles($user, $roleIds); |
@@ -148,11 +148,11 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public function login($email, $password) |
150 | 150 | { |
151 | - if (! $user = $this->repo->first(['email' => $email])) { |
|
151 | + if ( ! $user = $this->repo->first(['email' => $email])) { |
|
152 | 152 | \Errors::loginFailed(); |
153 | 153 | } elseif ($user->blocked) { |
154 | 154 | \Errors::userIsBlocked(); |
155 | - } elseif (! config('user.disable_confirm_email') && ! $user->confirmed) { |
|
155 | + } elseif ( ! config('user.disable_confirm_email') && ! $user->confirmed) { |
|
156 | 156 | \Errors::emailNotConfirmed(); |
157 | 157 | } |
158 | 158 | |
@@ -171,11 +171,11 @@ discard block |
||
171 | 171 | $accessToken = $authCode ? Arr::get(\Socialite::driver($type)->getAccessTokenResponse($authCode), 'access_token') : $accessToken; |
172 | 172 | $user = \Socialite::driver($type)->userFromToken($accessToken)->user; |
173 | 173 | |
174 | - if (! \Arr::has($user, 'email')) { |
|
174 | + if ( ! \Arr::has($user, 'email')) { |
|
175 | 175 | \Errors::noSocialEmail(); |
176 | 176 | } |
177 | 177 | |
178 | - if (! $this->repo->first(['email' => $user['email']])) { |
|
178 | + if ( ! $this->repo->first(['email' => $user['email']])) { |
|
179 | 179 | $this->register($user['name'], $user['email'], '', true); |
180 | 180 | } |
181 | 181 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | 'confirmed' => $skipConfirmEmail |
201 | 201 | ]); |
202 | 202 | |
203 | - if (! $skipConfirmEmail && ! config('user.disable_confirm_email')) { |
|
203 | + if ( ! $skipConfirmEmail && ! config('user.disable_confirm_email')) { |
|
204 | 204 | $this->sendConfirmationEmail($user->email); |
205 | 205 | } |
206 | 206 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | */ |
242 | 242 | public function sendReset($email) |
243 | 243 | { |
244 | - if (! $user = $this->repo->first(['email' => $email])) { |
|
244 | + if ( ! $user = $this->repo->first(['email' => $email])) { |
|
245 | 245 | \Errors::notFound('email'); |
246 | 246 | } |
247 | 247 | |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | 'password' => $password, |
266 | 266 | 'password_confirmation' => $passwordConfirmation, |
267 | 267 | 'token' => $token |
268 | - ], function ($user, $password) { |
|
268 | + ], function($user, $password) { |
|
269 | 269 | $this->repo->save(['id' => $user->id, 'password' => $password]); |
270 | 270 | }); |
271 | 271 | |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | public function changePassword($password, $oldPassword) |
299 | 299 | { |
300 | 300 | $user = \Auth::user(); |
301 | - if (! \Hash::check($oldPassword, $user->password)) { |
|
301 | + if ( ! \Hash::check($oldPassword, $user->password)) { |
|
302 | 302 | \Errors::invalidOldPassword(); |
303 | 303 | } |
304 | 304 | |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | */ |
314 | 314 | public function confirmEmail($confirmationCode) |
315 | 315 | { |
316 | - if (! $user = $this->repo->first(['confirmation_code' => $confirmationCode])) { |
|
316 | + if ( ! $user = $this->repo->first(['confirmation_code' => $confirmationCode])) { |
|
317 | 317 | \Errors::invalidConfirmationCode(); |
318 | 318 | } |
319 | 319 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | public function rules() |
25 | 25 | { |
26 | 26 | return [ |
27 | - 'name' => 'required|string|max:100|unique:roles,name,' . $this->route('id') |
|
27 | + 'name' => 'required|string|max:100|unique:roles,name,'.$this->route('id') |
|
28 | 28 | ]; |
29 | 29 | } |
30 | 30 | } |