@@ -46,7 +46,7 @@ |
||
| 46 | 46 | $app->bind('app', 'Illuminate\Container\Container'); |
| 47 | 47 | |
| 48 | 48 | foreach ($this->PACKAGE_CLASSES as $PACKAGE_CLASS) { |
| 49 | - $app->bind($PACKAGE_CLASS, $this->VENDOR.'\\'.$this->PACKAGE_NAME.'\\'.$PACKAGE_CLASS); |
|
| 49 | + $app->bind($PACKAGE_CLASS, $this->VENDOR . '\\' . $this->PACKAGE_NAME . '\\' . $PACKAGE_CLASS); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | $app->bind('Cache', 'Illuminate\Support\Facades\Cache'); |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | */ |
| 97 | 97 | public function getMethods() |
| 98 | 98 | { |
| 99 | - return (new ReflectionHelper())->getClassMethodsNames($this,\ReflectionMethod::IS_PUBLIC); |
|
| 99 | + return (new ReflectionHelper())->getClassMethodsNames($this, \ReflectionMethod::IS_PUBLIC); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | class BaseAuthModel extends Authenticatable |
| 15 | 15 | { |
| 16 | - use Searchable, PivotEventTrait,Notifiable, HasApiTokens, MetaTrait; |
|
| 16 | + use Searchable, PivotEventTrait, Notifiable, HasApiTokens, MetaTrait; |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * default relations of method |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function getMethods() |
| 102 | 102 | { |
| 103 | - return (new ReflectionHelper())->getClassMethodsNames($this,\ReflectionMethod::IS_PUBLIC); |
|
| 103 | + return (new ReflectionHelper())->getClassMethodsNames($this, \ReflectionMethod::IS_PUBLIC); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | $this->modelName = (new StringHelper)->singular(strtolower($model->getTable())); |
| 119 | 119 | $this->model = $model; |
| 120 | - array_push($middleware, 'restful');//add restful middleware |
|
| 120 | + array_push($middleware, 'restful'); //add restful middleware |
|
| 121 | 121 | $this->middleware($middleware); |
| 122 | 122 | } |
| 123 | 123 | |
@@ -153,8 +153,7 @@ discard block |
||
| 153 | 153 | $this->model |
| 154 | 154 | ->whereKey(collect($this->model |
| 155 | 155 | ->search(($request->get('query'))) |
| 156 | - ->raw())->get('ids')) : |
|
| 157 | - $this->model; |
|
| 156 | + ->raw())->get('ids')) : $this->model; |
|
| 158 | 157 | if (array_key_exists('file', $request->toArray())) { |
| 159 | 158 | //TODO add relation on top if here and create a tree flatter array in array helper |
| 160 | 159 | // (new ExcelHelper())->setOptions([ |
@@ -175,7 +174,7 @@ discard block |
||
| 175 | 174 | // TODO for beautiful response must be a module |
| 176 | 175 | $message = new App\Resources\MessageHelper(); |
| 177 | 176 | $message->setOption('isDefault', true); |
| 178 | - if ($request['beautiful_response']=='true' || $request['response']=='beautiful' || $request['response']=='flat') { |
|
| 177 | + if ($request['beautiful_response'] == 'true' || $request['response'] == 'beautiful' || $request['response'] == 'flat') { |
|
| 179 | 178 | $getCurrentClassFunction = $this->modelName . '.' . __FUNCTION__; |
| 180 | 179 | $responseParams = (new App\Resources\Config\ConfigHelper())->getFromResponse($getCurrentClassFunction); |
| 181 | 180 | if (!is_null($responseParams)) { |
@@ -287,26 +286,26 @@ discard block |
||
| 287 | 286 | $userId = auth()->id(); |
| 288 | 287 | |
| 289 | 288 | //add author id into the request if doesn't exist |
| 290 | - if(isset($request['author_id'])){ |
|
| 291 | - if (is_null($request['author_id'])){ |
|
| 289 | + if (isset($request['author_id'])) { |
|
| 290 | + if (is_null($request['author_id'])) { |
|
| 292 | 291 | $request['author_id'] = $userId; |
| 293 | 292 | } |
| 294 | - }else{ |
|
| 293 | + } else { |
|
| 295 | 294 | $request['author_id'] = $userId; |
| 296 | 295 | } |
| 297 | 296 | |
| 298 | 297 | //add user id into the request if doesn't exist |
| 299 | - if(isset($request['user_id'])){ |
|
| 300 | - if (is_null($request['user_id'])){ |
|
| 298 | + if (isset($request['user_id'])) { |
|
| 299 | + if (is_null($request['user_id'])) { |
|
| 301 | 300 | $request['user_id'] = $userId; |
| 302 | 301 | } |
| 303 | - }else{ |
|
| 302 | + } else { |
|
| 304 | 303 | $request['user_id'] = $userId; |
| 305 | 304 | } |
| 306 | 305 | |
| 307 | 306 | $validationErrors = $this->checkRequestValidation($request, $this->storeValidateArray); |
| 308 | 307 | if ($validationErrors != null) { |
| 309 | - if (env('APP_DEBUG',false)){ |
|
| 308 | + if (env('APP_DEBUG', false)) { |
|
| 310 | 309 | $response->setMessage(json_encode($validationErrors->getMessages())); |
| 311 | 310 | } |
| 312 | 311 | $response->setStatus(false); |
@@ -327,7 +326,7 @@ discard block |
||
| 327 | 326 | $response->setStatus(true); |
| 328 | 327 | return SmartResponse::response($response); |
| 329 | 328 | } catch (QueryException $exception) { |
| 330 | - if (env('APP_DEBUG',false)){ |
|
| 329 | + if (env('APP_DEBUG', false)) { |
|
| 331 | 330 | $response->setMessage($exception->getMessage()); |
| 332 | 331 | } |
| 333 | 332 | $response->setStatus(false); |
@@ -375,7 +374,7 @@ discard block |
||
| 375 | 374 | 200, |
| 376 | 375 | $this->model |
| 377 | 376 | ->where($this->model->getKeyName(), $id) |
| 378 | - ->with(collect($this->editLoad)->count() == 0 ? $this->indexLoad: $this->editLoad) |
|
| 377 | + ->with(collect($this->editLoad)->count() == 0 ? $this->indexLoad : $this->editLoad) |
|
| 379 | 378 | ->get() |
| 380 | 379 | ); |
| 381 | 380 | } catch (ModelNotFoundException $exception) { |
@@ -411,7 +410,7 @@ discard block |
||
| 411 | 410 | foreach ($this->pivotFields as $pivotField) { |
| 412 | 411 | if (collect($request[$pivotField])->count()) { |
| 413 | 412 | $pivotMethod = (new StringHelper())->toCamel($pivotField); |
| 414 | - $this->model->findOrFail($id)->$pivotMethod()->sync(json_decode($request[$pivotField],true)); |
|
| 413 | + $this->model->findOrFail($id)->$pivotMethod()->sync(json_decode($request[$pivotField], true)); |
|
| 415 | 414 | } |
| 416 | 415 | } |
| 417 | 416 | //get result of update |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | if (is_null($request['author_id'])){ |
| 292 | 292 | $request['author_id'] = $userId; |
| 293 | 293 | } |
| 294 | - }else{ |
|
| 294 | + } else{ |
|
| 295 | 295 | $request['author_id'] = $userId; |
| 296 | 296 | } |
| 297 | 297 | |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | if (is_null($request['user_id'])){ |
| 301 | 301 | $request['user_id'] = $userId; |
| 302 | 302 | } |
| 303 | - }else{ |
|
| 303 | + } else{ |
|
| 304 | 304 | $request['user_id'] = $userId; |
| 305 | 305 | } |
| 306 | 306 | |