Skip to content

Commit

Permalink
chore: merge PR Formfeed-UK#35 - Update Breadcrumbs.php to fix traver…
Browse files Browse the repository at this point in the history
…sable error
  • Loading branch information
shawnheide committed Oct 31, 2024
1 parent 925af66 commit 78cfad8
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Breadcrumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ protected function breadcrumbArray(NovaRequest $request) {

array_push($this->items, ...$this->rootBreadcrumb($request));

if ($this->pageType($request) === "lens") {
$lens = LensRequest::createFrom($request)->lens();

if (!is_null($lens) && property_exists($lens, "resolveParentBreadcrumbs") && $lens::$resolveParentBreadcrumbs === false) {
array_push($this->items, ...$this->lensBreadcrumb($request));
return;
}
}

if ($this->pageType($request) === "dashboard") {
array_push($this->items, ...$this->dashboardBreadcrumb($request));
return;
Expand Down Expand Up @@ -213,7 +222,7 @@ protected function dashboardBreadcrumb(NovaRequest $request) {
$dashboard = Nova::dashboardForKey($request->route("name"), $request);

if (is_null($dashboard)) {
return;
return [];
}

if (method_exists($dashboard, "dashboardBreadcrumb")) {
Expand All @@ -232,7 +241,7 @@ protected function lensBreadcrumb(NovaRequest $request) {
$lens = LensRequest::createFrom($request)->lens();

if (is_null($lens)) {
return;
return [];
}

if (method_exists($lens, "lensBreadcrumb")) {
Expand Down

0 comments on commit 78cfad8

Please sign in to comment.