@@ -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 | } |
@@ -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 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | public function assignPermissions($roleId, $permissionIds) |
29 | 29 | { |
30 | 30 | $role = false; |
31 | - \DB::transaction(function () use ($roleId, $permissionIds, &$role) { |
|
31 | + \DB::transaction(function() use ($roleId, $permissionIds, &$role) { |
|
32 | 32 | $role = $this->repo->find($roleId); |
33 | 33 | $this->repo->detachPermissions($role); |
34 | 34 | $this->repo->attachPermissions($role, $permissionIds); |
@@ -26,7 +26,7 @@ |
||
26 | 26 | */ |
27 | 27 | public function revoke($clientId) |
28 | 28 | { |
29 | - \DB::transaction(function () use ($clientId) { |
|
29 | + \DB::transaction(function() use ($clientId) { |
|
30 | 30 | $client = $this->repo->find($clientId); |
31 | 31 | $this->repo->revokeClientTokens($client); |
32 | 32 | $this->repo->save(['id'=> $clientId, 'revoked' => true]); |
@@ -19,12 +19,12 @@ |
||
19 | 19 | public function __call($name, $arguments) |
20 | 20 | { |
21 | 21 | foreach (\Module::all() as $module) { |
22 | - $nameSpace = 'App\\Modules\\' . $module['basename'] ; |
|
22 | + $nameSpace = 'App\\Modules\\'.$module['basename']; |
|
23 | 23 | $model = ucfirst(\Str::singular($name)); |
24 | - if(count($arguments) == 1 && $arguments[0]) { |
|
25 | - $class = $nameSpace . '\\Services\\' . $model . 'Service'; |
|
24 | + if (count($arguments) == 1 && $arguments[0]) { |
|
25 | + $class = $nameSpace.'\\Services\\'.$model.'Service'; |
|
26 | 26 | } else { |
27 | - $class = $nameSpace . '\\Repositories\\' . $model . 'Repository'; |
|
27 | + $class = $nameSpace.'\\Repositories\\'.$model.'Repository'; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | if (class_exists($class)) { |
@@ -40,7 +40,7 @@ |
||
40 | 40 | return $values; |
41 | 41 | } |
42 | 42 | |
43 | - if (! $primaryLocale || ! is_object($values) || ! property_exists($values, $primaryLocale)) { |
|
43 | + if ( ! $primaryLocale || ! is_object($values) || ! property_exists($values, $primaryLocale)) { |
|
44 | 44 | return $values ? (isset($values->$fallbackLocale) ? $values->$fallbackLocale : $values) : ''; |
45 | 45 | } |
46 | 46 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function __construct($model) |
23 | 23 | { |
24 | - $this->model = $model; |
|
24 | + $this->model = $model; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $model = false; |
99 | 99 | $relations = []; |
100 | 100 | |
101 | - \DB::transaction(function () use (&$model, &$relations, $data) { |
|
101 | + \DB::transaction(function() use (&$model, &$relations, $data) { |
|
102 | 102 | |
103 | 103 | $model = $this->prepareModel($data); |
104 | 104 | $relations = $this->prepareRelations($data, $model); |
@@ -122,8 +122,8 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function delete($value, $attribute = 'id') |
124 | 124 | { |
125 | - \DB::transaction(function () use ($value, $attribute) { |
|
126 | - $this->model->where($attribute, '=', $value)->lockForUpdate()->get()->each(function ($model) { |
|
125 | + \DB::transaction(function() use ($value, $attribute) { |
|
126 | + $this->model->where($attribute, '=', $value)->lockForUpdate()->get()->each(function($model) { |
|
127 | 127 | $model->delete(); |
128 | 128 | }); |
129 | 129 | }); |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | { |
214 | 214 | $model = $this->model->onlyTrashed()->find($id); |
215 | 215 | |
216 | - if (! $model) { |
|
216 | + if ( ! $model) { |
|
217 | 217 | \Errors::notFound(class_basename($this->model).' with id : '.$id); |
218 | 218 | } |
219 | 219 | |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | * @var array |
238 | 238 | */ |
239 | 239 | $model = Arr::has($data, 'id') ? $modelClass->lockForUpdate()->find($data['id']) : new $modelClass; |
240 | - if (! $model) { |
|
240 | + if ( ! $model) { |
|
241 | 241 | \Errors::notFound(class_basename($modelClass).' with id : '.$data['id']); |
242 | 242 | } |
243 | 243 | |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | * If the relation has no value then marke the relation data |
295 | 295 | * related to the model to be deleted. |
296 | 296 | */ |
297 | - if (! $value || ! count($value)) { |
|
297 | + if ( ! $value || ! count($value)) { |
|
298 | 298 | $relations[$relation] = 'delete'; |
299 | 299 | } |
300 | 300 | } |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | * Check if the relation is a collection. |
313 | 313 | */ |
314 | 314 | if (class_basename($model->$relation) == 'Collection') { |
315 | - if (! is_array($val)) { |
|
315 | + if ( ! is_array($val)) { |
|
316 | 316 | $relationModel = $relationBaseModel->lockForUpdate()->find($val); |
317 | 317 | } else { |
318 | 318 | /** |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | /** |
326 | 326 | * If model doesn't exists. |
327 | 327 | */ |
328 | - if (! $relationModel) { |
|
328 | + if ( ! $relationModel) { |
|
329 | 329 | \Errors::notFound(class_basename($relationBaseModel).' with id : '.$val['id']); |
330 | 330 | } |
331 | 331 | |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | /** |
364 | 364 | * If model doesn't exists. |
365 | 365 | */ |
366 | - if (! $relationModel) { |
|
366 | + if ( ! $relationModel) { |
|
367 | 367 | \Errors::notFound(class_basename($relationBaseModel).' with id : '.$value['id']); |
368 | 368 | } |
369 | 369 | |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | $value = $removeLast === false ? $value : substr($value, 0, $removeLast); |
574 | 574 | $path = explode('->', $value); |
575 | 575 | $field = array_shift($path); |
576 | - $result = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function ($part) { |
|
576 | + $result = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function($part) { |
|
577 | 577 | return '"'.$part.'"'; |
578 | 578 | })->implode('.')); |
579 | 579 |