File tree Expand file tree Collapse file tree 1 file changed +8
-14
lines changed
Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -569,21 +569,15 @@ protected function getRelationInputs($inputs = []): array
569569 $ relations = [];
570570
571571 foreach ($ inputs as $ column => $ value ) {
572- if (method_exists ($ this ->model , $ column )) {
573- $ relation = call_user_func ([$ this ->model , $ column ]);
574-
575- if ($ relation instanceof Relations \Relation) {
576- $ relations [$ column ] = $ value ;
577- }
578- } elseif (method_exists ($ this ->model , \Illuminate \Support \Str::camel ($ column ))) {
579- $ column = \Illuminate \Support \Str::camel ($ column );
580- $ relation = call_user_func ([$ this ->model , $ column ]);
581-
582- if ($ relation instanceof Relations \Relation) {
583- $ relations [$ column ] = $ value ;
584- }
585- }
572+ if (method_exists ($ this ->model , $ column ) ||
573+ method_exists ($ this ->model , $ column = Str::camel ($ column )))
574+ {
575+ $ relation = call_user_func ([$ this ->model , $ column ]);
586576
577+ if ($ relation instanceof Relations \Relation) {
578+ $ relations [$ column ] = $ value ;
579+ }
580+ }
587581 }
588582
589583 return $ relations ;
You can’t perform that action at this time.
0 commit comments