Skip to content

Commit

Permalink
Add condition to avoid error on global search
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom HENEAULT committed Feb 7, 2022
1 parent cae20b3 commit 0872edc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/NestedForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ public function __construct(string $name, $attribute = null, $resource = null)
$this->returnContext = $this;

// Nova ^3.3.x need this to fix cannot add relation on create mode
$this->resolve(app(NovaRequest::class)->model());
if(get_class(app(NovaRequest::class)) !== "Laravel\Nova\Http\Requests\GlobalSearchRequest")
$this->resolve(app(NovaRequest::class)->model());
}

/**
Expand Down

0 comments on commit 0872edc

Please sign in to comment.