diff --git a/src/Breadcrumbs.php b/src/Breadcrumbs.php index d140d52..8edfb1a 100644 --- a/src/Breadcrumbs.php +++ b/src/Breadcrumbs.php @@ -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; @@ -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")) { @@ -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")) {