Skip to content

Commit 14cc6b8

Browse files
committed
wip
1 parent dc194c1 commit 14cc6b8

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

src/Form.php

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)