@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | if (! empty($inputs[$key])) { |
| 174 | 174 | $filter_inputs = array_filter($inputs[$key], function ($item) { |
| 175 | - return !empty($item); |
|
| 175 | + return !empty($item); |
|
| 176 | 176 | }); |
| 177 | 177 | $model->{$relation['relation_name']}()->sync($filter_inputs); |
| 178 | 178 | } |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | |
| 231 | 231 | if (! empty($inputs[$key])) { |
| 232 | 232 | $filter_inputs = array_filter($inputs[$key], function ($item) { |
| 233 | - return !empty($item); |
|
| 233 | + return !empty($item); |
|
| 234 | 234 | }); |
| 235 | 235 | $model->{$relation['relation_name']}()->sync($filter_inputs); |
| 236 | 236 | } |
@@ -114,8 +114,8 @@ discard block |
||
| 114 | 114 | public function show(int $id) |
| 115 | 115 | { |
| 116 | 116 | $model = $this->model::findOrFail($id); |
| 117 | - $commentColumns = array_filter($this->getColumnsFromTable($model->comments()->getRelated()), function ($type, $name) use ($model) { |
|
| 118 | - return ! in_array($name, ['id', 'updated_at', $model->comments()->getForeignKeyName(), $model->comments()->getMorphType()]); |
|
| 117 | + $commentColumns = array_filter($this->getColumnsFromTable($model->comments()->getRelated()), function($type, $name) use ($model) { |
|
| 118 | + return !in_array($name, ['id', 'updated_at', $model->comments()->getForeignKeyName(), $model->comments()->getMorphType()]); |
|
| 119 | 119 | }, ARRAY_FILTER_USE_BOTH); |
| 120 | 120 | |
| 121 | 121 | return new HtmlString( |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | public function create(Request $request) |
| 159 | 159 | { |
| 160 | - $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function ($item) { |
|
| 160 | + $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function($item) { |
|
| 161 | 161 | return $item !== null; |
| 162 | 162 | }); |
| 163 | 163 | if (isset($inputs['password'])) { |
@@ -170,8 +170,8 @@ discard block |
||
| 170 | 170 | continue; |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - if (! empty($inputs[$key])) { |
|
| 174 | - $filter_inputs = array_filter($inputs[$key], function ($item) { |
|
| 173 | + if (!empty($inputs[$key])) { |
|
| 174 | + $filter_inputs = array_filter($inputs[$key], function($item) { |
|
| 175 | 175 | return !empty($item); |
| 176 | 176 | }); |
| 177 | 177 | $model->{$relation['relation_name']}()->sync($filter_inputs); |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | public function update(Request $request, int $id) |
| 216 | 216 | { |
| 217 | 217 | $model = $this->model::findOrFail($id); |
| 218 | - $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function ($item) { |
|
| 218 | + $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function($item) { |
|
| 219 | 219 | return $item !== null; |
| 220 | 220 | }); |
| 221 | 221 | if (isset($inputs['password'])) { |
@@ -228,8 +228,8 @@ discard block |
||
| 228 | 228 | continue; |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | - if (! empty($inputs[$key])) { |
|
| 232 | - $filter_inputs = array_filter($inputs[$key], function ($item) { |
|
| 231 | + if (!empty($inputs[$key])) { |
|
| 232 | + $filter_inputs = array_filter($inputs[$key], function($item) { |
|
| 233 | 233 | return !empty($item); |
| 234 | 234 | }); |
| 235 | 235 | $model->{$relation['relation_name']}()->sync($filter_inputs); |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | foreach ($methods as $method) { |
| 311 | 311 | if ( |
| 312 | 312 | $method->class != get_class($model) || |
| 313 | - ! empty($method->getParameters()) || |
|
| 313 | + !empty($method->getParameters()) || |
|
| 314 | 314 | $method->getName() == __FUNCTION__ |
| 315 | 315 | ) { |
| 316 | 316 | continue; |
@@ -380,8 +380,8 @@ discard block |
||
| 380 | 380 | */ |
| 381 | 381 | protected function getInputsWithFiles($request, $inputs) |
| 382 | 382 | { |
| 383 | - if (! empty($this->files)) { |
|
| 384 | - $files = array_filter($inputs, function ($item, $key) { |
|
| 383 | + if (!empty($this->files)) { |
|
| 384 | + $files = array_filter($inputs, function($item, $key) { |
|
| 385 | 385 | return in_array($key, $this->files) && $item instanceof UploadedFile; |
| 386 | 386 | }, ARRAY_FILTER_USE_BOTH); |
| 387 | 387 | |