diff --git a/src/Laravel/src/DependencyInjection/MoonShineConfigurator.php b/src/Laravel/src/DependencyInjection/MoonShineConfigurator.php index 260a25a02..9c278cd89 100644 --- a/src/Laravel/src/DependencyInjection/MoonShineConfigurator.php +++ b/src/Laravel/src/DependencyInjection/MoonShineConfigurator.php @@ -364,6 +364,16 @@ public function homeRoute(string|Closure $route): self return $this->set('home_route', $route); } + public function getHomeUrl(): ?string + { + return $this->get('home_url'); + } + + public function homeUrl(string|Closure $route): self + { + return $this->set('home_url', $route); + } + public function getAuthorizationRules(): Collection { return $this->authorizationRules; diff --git a/src/Laravel/src/MoonShineEndpoints.php b/src/Laravel/src/MoonShineEndpoints.php index 037d9ae05..ef57f2d22 100644 --- a/src/Laravel/src/MoonShineEndpoints.php +++ b/src/Laravel/src/MoonShineEndpoints.php @@ -155,6 +155,10 @@ public function toPage( public function home(): string { + if ($url = moonshineConfig()->getHomeUrl()) { + return $url; + } + return route( moonshineConfig()->getHomeRoute() );