Skip to content

Commit

Permalink
Merge pull request #170 from albertgpdev/master
Browse files Browse the repository at this point in the history
Fixes compatibility for fiedsForIndex, fieldsForDetails on Nova 3.X
  • Loading branch information
ragingdave authored May 5, 2021
2 parents 089764f + a0473b9 commit cea9d17
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/HasDependencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ trait HasDependencies
*/
public function availableFields(NovaRequest $request)
{
$method = $this->fieldsMethod($request);

// needs to be filtered once to resolve Panels
$fields = $this->filter($this->fields($request));
$fields = $this->filter($this->{$method}($request));
$availableFields = [];

foreach ($fields as $field) {
if ($field instanceof NovaDependencyContainer) {
$availableFields[] = $this->filterFieldForRequest($field, $request);
if($field->areDependenciesSatisfied($request) || $this->extractableRequest($request, $this->model())) {
if ($field->areDependenciesSatisfied($request) || $this->extractableRequest($request, $this->model())) {
if ($this->doesRouteRequireChildFields()) {
$this->extractChildFields($field->meta['fields']);
}
Expand Down

0 comments on commit cea9d17

Please sign in to comment.