Skip to content

Commit 7f1d343

Browse files
committed
first check for current panel and fallback to default panel
1 parent 5d3ac0f commit 7f1d343

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/FilamentMails.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ class FilamentMails
1414

1515
public static function setPath(?string $path = null): void
1616
{
17-
static::$path = $path ?? filament()->getDefaultPanel()->getPath();
17+
static::$path = $path ?? filament()->getPanel()?->getPath() ?? filament()->getDefaultPanel()->getPath();
1818
}
1919

2020
public static function setName(?string $name = null): void
2121
{
22-
static::$name = $name ?? 'filament.' . filament()->getDefaultPanel()->getId() . '.';
22+
static::$name = $name ?? 'filament.' . (filament()->getPanel()?->getId() ?? filament()->getDefaultPanel()->getId()) . '.';
2323
}
2424

2525
public static function routes(?string $path = null, ?string $name = null): void

0 commit comments

Comments
 (0)