Skip to content

Commit

Permalink
first check for current panel and fallback to default panel
Browse files Browse the repository at this point in the history
  • Loading branch information
markvaneijk committed Feb 25, 2025
1 parent 5d3ac0f commit 7f1d343
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/FilamentMails.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ class FilamentMails

public static function setPath(?string $path = null): void
{
static::$path = $path ?? filament()->getDefaultPanel()->getPath();
static::$path = $path ?? filament()->getPanel()?->getPath() ?? filament()->getDefaultPanel()->getPath();

Check failure on line 17 in src/FilamentMails.php

View workflow job for this annotation

GitHub Actions / phpstan

Expression on left side of ?? is not nullable.

Check failure on line 17 in src/FilamentMails.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Filament\Panel. Use -> instead.
}

public static function setName(?string $name = null): void
{
static::$name = $name ?? 'filament.' . filament()->getDefaultPanel()->getId() . '.';
static::$name = $name ?? 'filament.' . (filament()->getPanel()?->getId() ?? filament()->getDefaultPanel()->getId()) . '.';

Check failure on line 22 in src/FilamentMails.php

View workflow job for this annotation

GitHub Actions / phpstan

Expression on left side of ?? is not nullable.

Check failure on line 22 in src/FilamentMails.php

View workflow job for this annotation

GitHub Actions / phpstan

Using nullsafe method call on non-nullable type Filament\Panel. Use -> instead.
}

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

0 comments on commit 7f1d343

Please sign in to comment.