File tree Expand file tree Collapse file tree 2 files changed +2
-3
lines changed
src/app/Library/CrudPanel/Traits Expand file tree Collapse file tree 2 files changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -25,12 +25,11 @@ public function create($data)
2525 {
2626 $ data = $ this ->decodeJsonCastedAttributes ($ data );
2727 $ data = $ this ->compactFakeFields ($ data );
28+ $ data = $ this ->changeBelongsToNamesFromRelationshipToForeignKey ($ data );
2829
2930 // omit the n-n relationships when updating the eloquent item
3031 $ nn_relationships = Arr::pluck ($ this ->getRelationFieldsWithPivot (), 'name ' );
3132
32- $ data = $ this ->changeBelongsToNamesFromRelationshipToForeignKey ($ data , $ this ->getFields ());
33-
3433 $ item = $ this ->model ->create (Arr::except ($ data , $ nn_relationships ));
3534
3635 // if there are any relationships available, also sync those
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ public function update($id, $data)
2626 $ data = $ this ->compactFakeFields ($ data );
2727 $ item = $ this ->model ->findOrFail ($ id );
2828
29- $ data = $ this ->changeBelongsToNamesFromRelationshipToForeignKey ($ data, $ this -> getFields () );
29+ $ data = $ this ->changeBelongsToNamesFromRelationshipToForeignKey ($ data );
3030
3131 $ this ->createRelations ($ item , $ data );
3232
You can’t perform that action at this time.
0 commit comments