File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed
Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -569,18 +569,23 @@ protected function getRelationInputs($inputs = []): array
569569 $ relations = [];
570570
571571 foreach ($ inputs as $ column => $ value ) {
572- $ column = \Illuminate \Support \Str::camel ($ column );
573- if (!method_exists ($ this ->model , $ column )) {
574- continue ;
575- }
572+ if (method_exists ($ this ->model , $ column )) {
573+ $ relation = call_user_func ([$ this ->model , $ column ]);
576574
577- $ relation = call_user_func ([$ this ->model , $ column ]);
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 ]);
578581
579- if ($ relation instanceof Relations \Relation) {
580- $ relations [$ column ] = $ value ;
581- }
582- }
582+ if ($ relation instanceof Relations \Relation) {
583+ $ relations [$ column ] = $ value ;
584+ }
585+ }
583586
587+ }
588+
584589 return $ relations ;
585590 }
586591
You can’t perform that action at this time.
0 commit comments