@@ -19,8 +19,8 @@ |
||
| 19 | 19 | public function __call($name, $arguments) |
| 20 | 20 | { |
| 21 | 21 | foreach (\Module::all() as $module) { |
| 22 | - $nameSpace = 'App\\Modules\\' . $module['basename']; |
|
| 23 | - $class = $nameSpace . '\\Errors\\' . $module['basename'] . 'Errors'; |
|
| 22 | + $nameSpace = 'App\\Modules\\'.$module['basename']; |
|
| 23 | + $class = $nameSpace.'\\Errors\\'.$module['basename'].'Errors'; |
|
| 24 | 24 | |
| 25 | 25 | if (class_exists($class)) { |
| 26 | 26 | $class = \App::make($class); |
@@ -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 | /** |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $model = false; |
| 87 | 87 | $relations = []; |
| 88 | 88 | |
| 89 | - \DB::transaction(function () use (&$model, &$relations, $data) { |
|
| 89 | + \DB::transaction(function() use (&$model, &$relations, $data) { |
|
| 90 | 90 | |
| 91 | 91 | $model = $this->prepareModel($data); |
| 92 | 92 | $relations = $this->prepareRelations($data, $model); |
@@ -110,8 +110,8 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | public function delete($value, $attribute = 'id') |
| 112 | 112 | { |
| 113 | - \DB::transaction(function () use ($value, $attribute) { |
|
| 114 | - $this->model->where($attribute, '=', $value)->lockForUpdate()->get()->each(function ($model) { |
|
| 113 | + \DB::transaction(function() use ($value, $attribute) { |
|
| 114 | + $this->model->where($attribute, '=', $value)->lockForUpdate()->get()->each(function($model) { |
|
| 115 | 115 | $model->delete(); |
| 116 | 116 | }); |
| 117 | 117 | }); |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | { |
| 202 | 202 | $model = $this->model->onlyTrashed()->find($id); |
| 203 | 203 | |
| 204 | - if (! $model) { |
|
| 204 | + if ( ! $model) { |
|
| 205 | 205 | \Errors::notFound(class_basename($this->model).' with id : '.$id); |
| 206 | 206 | } |
| 207 | 207 | |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | * @var array |
| 226 | 226 | */ |
| 227 | 227 | $model = Arr::has($data, 'id') ? $modelClass->lockForUpdate()->find($data['id']) : new $modelClass; |
| 228 | - if (! $model) { |
|
| 228 | + if ( ! $model) { |
|
| 229 | 229 | \Errors::notFound(class_basename($modelClass).' with id : '.$data['id']); |
| 230 | 230 | } |
| 231 | 231 | |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | * If the relation has no value then marke the relation data |
| 283 | 283 | * related to the model to be deleted. |
| 284 | 284 | */ |
| 285 | - if (! $value || ! count($value)) { |
|
| 285 | + if ( ! $value || ! count($value)) { |
|
| 286 | 286 | $relations[$relation] = 'delete'; |
| 287 | 287 | } |
| 288 | 288 | } |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | /** |
| 310 | 310 | * If model doesn't exists. |
| 311 | 311 | */ |
| 312 | - if (! $relationModel) { |
|
| 312 | + if ( ! $relationModel) { |
|
| 313 | 313 | \Errors::notFound(class_basename($relationBaseModel).' with id : '.$val['id']); |
| 314 | 314 | } |
| 315 | 315 | |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | /** |
| 341 | 341 | * If model doesn't exists. |
| 342 | 342 | */ |
| 343 | - if (! $relationModel) { |
|
| 343 | + if ( ! $relationModel) { |
|
| 344 | 344 | \Errors::notFound(class_basename($relationBaseModel).' with id : '.$value['id']); |
| 345 | 345 | } |
| 346 | 346 | |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | $value = $removeLast === false ? $value : substr($value, 0, $removeLast); |
| 547 | 547 | $path = explode('->', $value); |
| 548 | 548 | $field = array_shift($path); |
| 549 | - $result = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function ($part) { |
|
| 549 | + $result = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function($part) { |
|
| 550 | 550 | return '"'.$part.'"'; |
| 551 | 551 | })->implode('.')); |
| 552 | 552 | |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | | |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -Route::group(['prefix' => 'oauth/clients'], function () { |
|
| 14 | +Route::group(['prefix' => 'oauth/clients'], function() { |
|
| 15 | 15 | |
| 16 | 16 | Route::get('/', 'OauthClientController@index'); |
| 17 | 17 | Route::get('{id}', 'OauthClientController@show'); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | | |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | -Route::group(['prefix' => 'permissions'], function () { |
|
| 16 | +Route::group(['prefix' => 'permissions'], function() { |
|
| 17 | 17 | |
| 18 | 18 | Route::get('/', 'PermissionController@index'); |
| 19 | 19 | Route::get('/{id}', 'PermissionController@show'); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | | |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -Route::group(['prefix' => 'reports'], function () { |
|
| 14 | +Route::group(['prefix' => 'reports'], function() { |
|
| 15 | 15 | |
| 16 | 16 | Route::get('/', 'ReportController@index'); |
| 17 | 17 | Route::get('/{id}', 'ReportController@show'); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | | |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | -Route::group(['prefix' => 'push/notification/devices'], function () { |
|
| 16 | +Route::group(['prefix' => 'push/notification/devices'], function() { |
|
| 17 | 17 | |
| 18 | 18 | Route::get('/', 'PushNotificationDeviceController@index'); |
| 19 | 19 | Route::get('{id}', 'PushNotificationDeviceController@show'); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | | |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | -Route::group(['prefix' => 'DummyRoutePrefix'], function () { |
|
| 16 | +Route::group(['prefix' => 'DummyRoutePrefix'], function() { |
|
| 17 | 17 | |
| 18 | 18 | Route::get('/', 'DummyController@index'); |
| 19 | 19 | Route::get('{id}', 'DummyController@show'); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | | |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -Route::group(['prefix' => 'settings'], function () { |
|
| 14 | +Route::group(['prefix' => 'settings'], function() { |
|
| 15 | 15 | |
| 16 | 16 | Route::get('/', 'SettingController@index'); |
| 17 | 17 | Route::get('{id}', 'SettingController@show'); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | | |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | -Route::group(['prefix' => 'roles'], function () { |
|
| 16 | +Route::group(['prefix' => 'roles'], function() { |
|
| 17 | 17 | |
| 18 | 18 | Route::get('/', 'RoleController@index'); |
| 19 | 19 | Route::get('{id}', 'RoleController@show'); |