@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | protected function addFallthroughRoute($controller, $uri) |
117 | 117 | { |
118 | - $localizedUri = app('translator')->get('routes.' . $uri . '.'); |
|
118 | + $localizedUri = app('translator')->get('routes.'.$uri.'.'); |
|
119 | 119 | if (false !== strpos($localizedUri, '.')) { |
120 | 120 | $localizedUri = $uri; |
121 | 121 | } |
@@ -134,9 +134,9 @@ discard block |
||
134 | 134 | $localizedUriTranslationBitParts = []; |
135 | 135 | while (list($level, $bitName) = each($uriExploded)) { |
136 | 136 | if ($level == 0) { |
137 | - $localizedUriTranslationBitParts[$level] = 'routes.' . $bitName . '.'; |
|
137 | + $localizedUriTranslationBitParts[$level] = 'routes.'.$bitName.'.'; |
|
138 | 138 | } else { |
139 | - $localizedUriTranslationBitParts[$level] = trim($localizedUriTranslationBitParts[$level - 1], '.') . '.' . $bitName; |
|
139 | + $localizedUriTranslationBitParts[$level] = trim($localizedUriTranslationBitParts[$level - 1], '.').'.'.$bitName; |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 | foreach ($localizedUriTranslationBitParts as $level => &$translationBitPart) { |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | protected function addResourceCreate($name, $base, $controller, $options) |
25 | 25 | { |
26 | - $uri = $this->getResourceUri($name) . '/' . app('translator')->get('routes..resources.create'); |
|
26 | + $uri = $this->getResourceUri($name).'/'.app('translator')->get('routes..resources.create'); |
|
27 | 27 | |
28 | 28 | $action = $this->getResourceAction($name, $controller, 'create', $options); |
29 | 29 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | protected function addResourceEdit($name, $base, $controller, $options) |
44 | 44 | { |
45 | - $uri = $this->getResourceUri($name) . '/{' . $base . '}/' . app('translator')->get('routes..resources.edit'); |
|
45 | + $uri = $this->getResourceUri($name).'/{'.$base.'}/'.app('translator')->get('routes..resources.edit'); |
|
46 | 46 | |
47 | 47 | $action = $this->getResourceAction($name, $controller, 'edit', $options); |
48 | 48 |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $validator = app('validator')->make($this->request->all(), [ |
59 | 59 | 'name' => 'sometimes|required|max:255', |
60 | 60 | 'email' => 'required|email|max:255|unique:users', |
61 | - 'password' => 'required|confirmed|min:' . config('auth.passwords.users.min_length'), |
|
61 | + 'password' => 'required|confirmed|min:'.config('auth.passwords.users.min_length'), |
|
62 | 62 | ]); |
63 | 63 | if ($validator->fails()) { |
64 | 64 | throw new ValidationException($validator); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | public function registerViaOAuth(SocialiteUser $oauthUserData, $provider) |
83 | 83 | { |
84 | 84 | if (!($ownerAccount = User::withTrashed()->whereEmail($oauthUserData->email)->first())) { |
85 | - $ownerAccount = \Eloquent::unguarded(function () use ($oauthUserData, $provider) { |
|
85 | + $ownerAccount = \Eloquent::unguarded(function() use ($oauthUserData, $provider) { |
|
86 | 86 | $user = User::create([ |
87 | 87 | 'name' => $oauthUserData->name, |
88 | 88 | 'email' => $oauthUserData->email, |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | public function delete($id) |
147 | 147 | { |
148 | 148 | $validator = app('validator')->make($this->request->all(), [ |
149 | - 'password' => 'required|min:' . config('auth.passwords.users.min_length'), |
|
149 | + 'password' => 'required|min:'.config('auth.passwords.users.min_length'), |
|
150 | 150 | ]); |
151 | 151 | if ($validator->fails()) { |
152 | 152 | throw new ValidationException($validator); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | throw new PasswordNotValidException; |
158 | 158 | } |
159 | 159 | |
160 | - return (bool)User::destroy($id); |
|
160 | + return (bool) User::destroy($id); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | |
188 | 188 | $validator = app('validator')->make($this->request->all(), [ |
189 | 189 | 'name' => 'sometimes|required|max:255', |
190 | - 'email' => 'required|email|max:255|unique:users,email,' . $id |
|
190 | + 'email' => 'required|email|max:255|unique:users,email,'.$id |
|
191 | 191 | ]); |
192 | 192 | if ($validator->fails()) { |
193 | 193 | throw new ValidationException($validator); |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | $validator = app('validator')->make($this->request->all(), [ |
299 | 299 | 'token' => 'required|string', |
300 | 300 | 'email' => 'required|email|max:255', |
301 | - 'password' => 'required|confirmed|min:' . app('config')->get('auth.passwords.users.min_length') |
|
301 | + 'password' => 'required|confirmed|min:'.app('config')->get('auth.passwords.users.min_length') |
|
302 | 302 | ]); |
303 | 303 | if ($validator->fails()) { |
304 | 304 | throw new ValidationException($validator); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | { |
46 | 46 | $this->filesystem = app('filesystem')->disk(); |
47 | 47 | $this->chunksExpireIn = config('filesystems.disks.local.chunks_expire_in'); |
48 | - $this->temporaryChunksFolder = DIRECTORY_SEPARATOR . '_chunks'; |
|
48 | + $this->temporaryChunksFolder = DIRECTORY_SEPARATOR.'_chunks'; |
|
49 | 49 | if (app('config')->has('filesystems.chunks_ttl') && is_int(config('filesystems.chunks_ttl'))) { |
50 | 50 | $this->chunksExpireIn = config('filesystems.chunks_ttl'); |
51 | 51 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | # Temp folder writable? |
91 | - if (!is_writable($absolutePathToTemporaryChunksFolder = config('filesystems.disks.local.root') . $this->temporaryChunksFolder) || !is_executable($absolutePathToTemporaryChunksFolder)) { |
|
91 | + if (!is_writable($absolutePathToTemporaryChunksFolder = config('filesystems.disks.local.root').$this->temporaryChunksFolder) || !is_executable($absolutePathToTemporaryChunksFolder)) { |
|
92 | 92 | throw new FileStreamExceptions\TemporaryUploadFolderNotWritableException; |
93 | 93 | } |
94 | 94 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | |
138 | 138 | if ($totalNumberOfChunks > 1) { |
139 | 139 | $chunkIndex = intval($request->get('qqpartindex')); |
140 | - $targetFolder = $this->temporaryChunksFolder . DIRECTORY_SEPARATOR . $fineUploaderUuid; |
|
140 | + $targetFolder = $this->temporaryChunksFolder.DIRECTORY_SEPARATOR.$fineUploaderUuid; |
|
141 | 141 | if (!$this->filesystem->exists($targetFolder)) { |
142 | 142 | $this->filesystem->makeDirectory($targetFolder); |
143 | 143 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | if (!$file->isValid()) { |
146 | 146 | throw new FileStreamExceptions\UploadAttemptFailedException; |
147 | 147 | } |
148 | - $file->move(storage_path('app' . $targetFolder), $chunkIndex); |
|
148 | + $file->move(storage_path('app'.$targetFolder), $chunkIndex); |
|
149 | 149 | |
150 | 150 | return response()->json(['success' => true, 'uuid' => $fineUploaderUuid]); |
151 | 151 | } else { |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | { |
168 | 168 | $fineUploaderUuid = $request->get('qquuid'); |
169 | 169 | $chunkIndex = intval($request->get('qqpartindex')); |
170 | - $numberOfExistingChunks = count($this->filesystem->files($this->temporaryChunksFolder . DIRECTORY_SEPARATOR . $fineUploaderUuid)); |
|
170 | + $numberOfExistingChunks = count($this->filesystem->files($this->temporaryChunksFolder.DIRECTORY_SEPARATOR.$fineUploaderUuid)); |
|
171 | 171 | if ($numberOfExistingChunks < $chunkIndex) { |
172 | 172 | throw new FileStreamExceptions\UploadIncompleteException; |
173 | 173 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $decimalPrefices = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; |
212 | 212 | $factor = intval(floor((strlen($bytes) - 1) / 3)); |
213 | 213 | |
214 | - return sprintf("%.{$decimals}f", $bytes / pow($binary ? 1024 : 1000, $factor)) . ' ' . $binary ? $binaryPrefices[$factor] : $decimalPrefices[$factor]; |
|
214 | + return sprintf("%.{$decimals}f", $bytes / pow($binary ? 1024 : 1000, $factor)).' '.$binary ? $binaryPrefices[$factor] : $decimalPrefices[$factor]; |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | /** |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | */ |
222 | 222 | public function getAbsolutePath($path) |
223 | 223 | { |
224 | - return config('filesystems.disks.local.root') . DIRECTORY_SEPARATOR . trim($path, DIRECTORY_SEPARATOR); |
|
224 | + return config('filesystems.disks.local.root').DIRECTORY_SEPARATOR.trim($path, DIRECTORY_SEPARATOR); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | /** |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | { |
271 | 271 | # Prelim |
272 | 272 | $fineUploaderUuid = $request->get('qquuid'); |
273 | - $chunksFolder = $this->temporaryChunksFolder . DIRECTORY_SEPARATOR . $fineUploaderUuid; |
|
273 | + $chunksFolder = $this->temporaryChunksFolder.DIRECTORY_SEPARATOR.$fineUploaderUuid; |
|
274 | 274 | $totalNumberOfChunks = $request->has('qqtotalparts') ? intval($request->get('qqtotalparts')) : 1; |
275 | 275 | |
276 | 276 | # Do we have all chunks? |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | # We have all chunks, proceed with combine. |
283 | 283 | $targetStream = fopen($this->getAbsolutePath($fineUploaderUuid), 'wb'); |
284 | 284 | for ($i = 0; $i < $totalNumberOfChunks; $i++) { |
285 | - $chunkStream = fopen($this->getAbsolutePath($chunksFolder . DIRECTORY_SEPARATOR . $i), 'rb'); |
|
285 | + $chunkStream = fopen($this->getAbsolutePath($chunksFolder.DIRECTORY_SEPARATOR.$i), 'rb'); |
|
286 | 286 | stream_copy_to_stream($chunkStream, $targetStream); |
287 | 287 | fclose($chunkStream); |
288 | 288 | } |
@@ -50,7 +50,7 @@ |
||
50 | 50 | throw new \Exception(); |
51 | 51 | } |
52 | 52 | |
53 | - return $query->where('mime', 'like', $type . '/%'); |
|
53 | + return $query->where('mime', 'like', $type.'/%'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | # Fetch reference entity |
51 | 51 | $referenceEntity = \DB::table($this->table)->where('id', $referenceEntityId)->first(); |
52 | 52 | if (is_null($referenceEntity)) { |
53 | - throw new \InvalidArgumentException("Reference entity with id: " . $referenceEntityId . " not found!"); |
|
53 | + throw new \InvalidArgumentException("Reference entity with id: ".$referenceEntityId." not found!"); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | \DB::transaction( |
57 | - function () use ($newEntityName, $referenceEntity) { |
|
57 | + function() use ($newEntityName, $referenceEntity) { |
|
58 | 58 | # Create new entity |
59 | 59 | $newEntity = \DB::table($this->table); |
60 | 60 | |
@@ -91,11 +91,11 @@ discard block |
||
91 | 91 | # Fetch reference entity |
92 | 92 | $referenceEntity = \DB::table($this->table)->where('id', $referenceEntityId)->first(); |
93 | 93 | if (is_null($referenceEntity)) { |
94 | - throw new \InvalidArgumentException("Reference entity with id: " . $referenceEntityId . " not found!"); |
|
94 | + throw new \InvalidArgumentException("Reference entity with id: ".$referenceEntityId." not found!"); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | \DB::transaction( |
98 | - function () use ($newEntityName, $referenceEntity) { |
|
98 | + function() use ($newEntityName, $referenceEntity) { |
|
99 | 99 | # Create new entity |
100 | 100 | $newEntity = \DB::table($this->table); |
101 | 101 | |
@@ -147,11 +147,11 @@ discard block |
||
147 | 147 | # Fetch reference entity |
148 | 148 | $referenceEntity = \DB::table($this->table)->where('id', $referenceEntityId)->first(); |
149 | 149 | if (is_null($referenceEntity)) { |
150 | - throw new \InvalidArgumentException("Reference entity with id: " . $referenceEntityId . " not found!"); |
|
150 | + throw new \InvalidArgumentException("Reference entity with id: ".$referenceEntityId." not found!"); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | \DB::transaction( |
154 | - function () use ($newEntityName, $referenceEntity) { |
|
154 | + function() use ($newEntityName, $referenceEntity) { |
|
155 | 155 | # Create new entity |
156 | 156 | $newEntity = \DB::table($this->table); |
157 | 157 | |
@@ -188,11 +188,11 @@ discard block |
||
188 | 188 | # Fetch reference entity |
189 | 189 | $referenceEntity = \DB::table($this->table)->where('id', $referenceEntityId)->first(); |
190 | 190 | if (is_null($referenceEntity)) { |
191 | - throw new \InvalidArgumentException("Reference entity with id: " . $referenceEntityId . " not found!"); |
|
191 | + throw new \InvalidArgumentException("Reference entity with id: ".$referenceEntityId." not found!"); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | \DB::transaction( |
195 | - function () use ($newEntityName, $referenceEntity) { |
|
195 | + function() use ($newEntityName, $referenceEntity) { |
|
196 | 196 | # Create new entity |
197 | 197 | $newEntity = \DB::table($this->table); |
198 | 198 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | # Round up delete-ables |
223 | 223 | $referenceEntity = \DB::table($this->table)->select('left_range', 'right_range', \DB::raw('right_range - left_range + 1 as range_width'))->where('id', $id)->first(); |
224 | 224 | if (is_null($referenceEntity)) { |
225 | - throw new \InvalidArgumentException("Reference entity with id: " . $id . " not found!"); |
|
225 | + throw new \InvalidArgumentException("Reference entity with id: ".$id." not found!"); |
|
226 | 226 | } |
227 | 227 | $completeListOfEntitiesToDeleteIncludingOrphans = \DB::table($this->table) |
228 | 228 | ->where('left_range', '>=', $referenceEntity->left_range) |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | |
231 | 231 | # Perform either a soft-delete or hard-delete |
232 | 232 | return \DB::transaction( |
233 | - function () use ($referenceEntity, $doSoftDelete, $completeListOfEntitiesToDeleteIncludingOrphans) { |
|
233 | + function() use ($referenceEntity, $doSoftDelete, $completeListOfEntitiesToDeleteIncludingOrphans) { |
|
234 | 234 | if ($doSoftDelete) { |
235 | 235 | # Soft delete |
236 | 236 | $removeResult = $completeListOfEntitiesToDeleteIncludingOrphans->update(['deleted_at' => Carbon::now()]); |
@@ -241,10 +241,10 @@ discard block |
||
241 | 241 | # Update ranges |
242 | 242 | \DB::table($this->table) |
243 | 243 | ->where('right_range', '>', $referenceEntity->right_range) |
244 | - ->update(['right_range' => \DB::raw('right_range - ' . $referenceEntity->range_width)]); |
|
244 | + ->update(['right_range' => \DB::raw('right_range - '.$referenceEntity->range_width)]); |
|
245 | 245 | \DB::table($this->table) |
246 | 246 | ->where('left_range', '>', $referenceEntity->right_range) |
247 | - ->update(['left_range' => \DB::raw('left_range - ' . $referenceEntity->range_width)]); |
|
247 | + ->update(['left_range' => \DB::raw('left_range - '.$referenceEntity->range_width)]); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | return $removeResult; |
@@ -274,11 +274,11 @@ discard block |
||
274 | 274 | |
275 | 275 | # Prelim |
276 | 276 | empty($id) && $id = 1; |
277 | - $nestedEntities = \DB::table($this->table . ' as node') |
|
277 | + $nestedEntities = \DB::table($this->table.' as node') |
|
278 | 278 | ->select('node.id', 'node.name') |
279 | 279 | ->leftJoin( |
280 | - $this->table . ' as parent', |
|
281 | - function (JoinClause $join) { |
|
280 | + $this->table.' as parent', |
|
281 | + function(JoinClause $join) { |
|
282 | 282 | $join->on('node.left_range', '<=', 'parent.right_range') |
283 | 283 | ->on('node.left_range', '>=', 'parent.left_range'); |
284 | 284 | }); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | // Non-localized, generic routes (such as those for admin panel etc). |
47 | 47 | //----------------------------------------------------------------------- |
48 | 48 | |
49 | - $router->group(compact('namespace', 'middleware'), function (Router $router) { |
|
49 | + $router->group(compact('namespace', 'middleware'), function(Router $router) { |
|
50 | 50 | $router->get('/oauth/{provider}', 'Users\AuthController@getOAuth'); |
51 | 51 | }); |
52 | 52 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | // Set localized routers. |
65 | - $router->group(compact('namespace', 'middleware', 'prefix'), function (Router $router) use ($prefix) { |
|
65 | + $router->group(compact('namespace', 'middleware', 'prefix'), function(Router $router) use ($prefix) { |
|
66 | 66 | $this->localizedRoutes($router, $prefix); |
67 | 67 | }); |
68 | 68 | } |
@@ -72,17 +72,17 @@ discard block |
||
72 | 72 | //------------------------------------------------ |
73 | 73 | |
74 | 74 | app('translator')->setLocale($defaultLocale); |
75 | - $router->group(compact('namespace', 'middleware'), function (Router $router) use ($defaultLocale) { |
|
75 | + $router->group(compact('namespace', 'middleware'), function(Router $router) use ($defaultLocale) { |
|
76 | 76 | $this->localizedRoutes($router, $defaultLocale); |
77 | 77 | }); |
78 | 78 | } |
79 | 79 | |
80 | 80 | protected function localizedRoutes(Router $router, $prefix) |
81 | 81 | { |
82 | - $router->get('login/{provider?}', ['uses' => 'Users\AuthController@getLogin', 'as' => $prefix . '.login']); |
|
82 | + $router->get('login/{provider?}', ['uses' => 'Users\AuthController@getLogin', 'as' => $prefix.'.login']); |
|
83 | 83 | $router->post('login/{provider?}', 'Users\AuthController@postLogin'); |
84 | - $router->get('logout', ['uses' => 'Users\AuthController@getLogout', 'as' => $prefix . '.logout']); |
|
85 | - $router->get('register', ['uses' => 'UsersController@create', 'as' => $prefix . '.register']); |
|
84 | + $router->get('logout', ['uses' => 'Users\AuthController@getLogout', 'as' => $prefix.'.logout']); |
|
85 | + $router->get('register', ['uses' => 'UsersController@create', 'as' => $prefix.'.register']); |
|
86 | 86 | $router->post('register', 'UsersController@store'); |
87 | 87 | |
88 | 88 | $router->resource('users', 'UsersController'); |
@@ -43,7 +43,7 @@ |
||
43 | 43 | 'connections' => [ |
44 | 44 | 'sqlite' => [ |
45 | 45 | 'driver' => 'sqlite', |
46 | - 'database' => storage_path() . '/database.sqlite', |
|
46 | + 'database' => storage_path().'/database.sqlite', |
|
47 | 47 | 'prefix' => '', |
48 | 48 | ], |
49 | 49 | 'mysql' => [ |