Skip to content

Commit

Permalink
Merge pull request #35 from petyots/master
Browse files Browse the repository at this point in the history
NovaBelongsToDepend can be placed after another fields
  • Loading branch information
orlyapps authored Apr 29, 2019
2 parents 5ff89c5 + 7798cc1 commit 8fca854
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Http/Controllers/FieldController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ public function index(NovaRequest $request)
}
return $field;
})->flatten();

$fields = $fields->filter(function ($value) use ($request) {
return ($value instanceof NovaBelongsToDepend);
});

$field = $fields->first(function ($value, $key) use ($request) {
return ($value instanceof NovaBelongsToDepend && $value->attribute == $request->attribute);
Expand Down

0 comments on commit 8fca854

Please sign in to comment.