We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3642596 commit 864c21eCopy full SHA for 864c21e
src/Http/Controllers/ApiController.php
@@ -39,20 +39,16 @@ function ($item) {
39
40
protected function updatePartial(Slide $slide, Request $request)
41
{
42
- $data = [];
43
- foreach ($request->all() as $column => $content) {
44
- if (is_array($content)) {
45
- foreach ($content as $key => $value) {
46
- $data[$column.'->'.$key] = $value;
+ foreach ($request->only('status', 'position') as $key => $content) {
+ if ($slide->isTranslatableAttribute($key)) {
+ foreach ($content as $lang => $value) {
+ $slide->setTranslation($key, $lang, $value);
47
}
48
} else {
49
- $data[$column] = $content;
+ $slide->{$key} = $content;
50
51
52
53
- foreach ($data as $key => $value) {
54
- $slide->{$key} = $value;
55
- }
56
$slide->save();
57
58
0 commit comments