Skip to content

Commit 3bec324

Browse files
committed
fix: use panel-defined slugAttribute instead of default 'tenant'
1 parent 7a9bbd5 commit 3bec324

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/BreezyCore.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function boot(Panel $panel): void
126126

127127
if ($this->myProfile['shouldRegisterUserMenu']) {
128128
if ($panel->hasTenancy()) {
129-
$tenantId = request()->route()->parameter('tenant');
129+
$tenantId = request()->route()->parameter($panel->getTenantSlugAttribute() ?? 'tenant');
130130
if ($tenantId && $tenant = app($panel->getTenantModel())::where($panel->getTenantSlugAttribute() ?? 'id', $tenantId)->first()) {
131131
$panel->userMenuItems([
132132
'account' => MenuItem::make()->url($this->getMyProfilePageClass()::getUrl(panel: $panel->getId(), tenant: $tenant))->label($this->myProfile['userMenuLabel']),

0 commit comments

Comments
 (0)