@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$factory->define(App\Modules\Core\Setting::class, function (Faker\Generator $faker) { |
|
3 | +$factory->define(App\Modules\Core\Setting::class, function(Faker\Generator $faker) { |
|
4 | 4 | return [ |
5 | 5 | 'name' => $faker->randomElement(['Company Name', 'Title', 'Header Image']), |
6 | 6 | 'value' => $faker->word(), |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | $permission = $routeActions[1]; |
61 | 61 | |
62 | 62 | $this->auth->shouldUse('api'); |
63 | - if (! in_array($permission, $skipLoginCheck)) { |
|
64 | - $this->authMiddleware->handle($request, function ($request) use ($modelName, $skipPermissionCheck, $skipLoginCheck, $permission) { |
|
63 | + if ( ! in_array($permission, $skipLoginCheck)) { |
|
64 | + $this->authMiddleware->handle($request, function($request) use ($modelName, $skipPermissionCheck, $skipLoginCheck, $permission) { |
|
65 | 65 | $user = $this->auth->user(); |
66 | 66 | $isPasswordClient = $user->token()->client->password_client; |
67 | 67 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | } |
71 | 71 | |
72 | 72 | if ($isPasswordClient && (in_array($permission, $skipPermissionCheck) || $this->core->users()->can($permission, $modelName))) { |
73 | - } elseif (! $isPasswordClient && $user->tokenCan($modelName.'-'.$permission)) { |
|
73 | + } elseif ( ! $isPasswordClient && $user->tokenCan($modelName.'-'.$permission)) { |
|
74 | 74 | } else { |
75 | 75 | $this->errorHandler->noPermissions(); |
76 | 76 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | protected function getRoutes() |
85 | 85 | { |
86 | - return collect(\Route::getRoutes())->map(function ($route) { |
|
86 | + return collect(\Route::getRoutes())->map(function($route) { |
|
87 | 87 | if (strpos($route->uri(), 'api/') !== false) { |
88 | 88 | return [ |
89 | 89 | 'method' => $route->methods()[0], |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | ]; |
115 | 115 | |
116 | 116 | |
117 | - if (! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) { |
|
117 | + if ( ! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) { |
|
118 | 118 | $route['headers']['Authorization'] = 'Bearer {token}'; |
119 | 119 | } |
120 | 120 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | if (count($parameters)) { |
163 | 163 | $className = optional($reflectionMethod->getParameters()[0]->getType())->getName(); |
164 | 164 | if ($className) { |
165 | - $reflectionClass = new \ReflectionClass($className); |
|
165 | + $reflectionClass = new \ReflectionClass($className); |
|
166 | 166 | |
167 | 167 | if ($reflectionClass->hasMethod('rules')) { |
168 | 168 | $reflectionMethod = $reflectionClass->getMethod('rules'); |