🆙 Add more fixes 🆙

This commit is contained in:
Remco
2026-02-02 20:56:28 +01:00
parent 0ca57c9a91
commit e6ed904f14
19 changed files with 1927 additions and 2302 deletions
+7 -5
View File
@@ -34,9 +34,9 @@ class BadgePage extends Page
protected static string $translateIdentifier = 'badge-resource';
public $badgeWasPreviouslyCreated;
public bool $badgeWasPreviouslyCreated = false;
public ?array $data = [];
public array $data = [];
public static string $roleName = 'badge_page';
@@ -47,9 +47,11 @@ class BadgePage extends Page
public function getTitle(): string|Htmlable
{
return __(
$translated = __(
sprintf('filament::resources.resources.%s.navigation_label', static::$translateIdentifier),
);
return is_array($translated) ? (string) ($translated[0] ?? '') : (string) $translated;
}
public function form(Schema $schema): Schema
@@ -62,7 +64,7 @@ class BadgePage extends Page
->label(__('filament::resources.inputs.badge_code'))
->helperText(__('filament::resources.helpers.badge_code_helper'))
->afterStateUpdated(function (?string $state, Set $set) {
$set('code', strtoupper($state));
$set('code', strtoupper((string) $state));
})
->suffixAction(fn (): PageAction => PageAction::make('search')->icon('heroicon-o-magnifying-glass')->action(fn () => $this->searchBadgesByCode()),
),
@@ -131,7 +133,7 @@ class BadgePage extends Page
}
$badgeData = app(ExternalTextsParser::class)->getBadgeData($badgeCode);
$this->badgeWasPreviouslyCreated = is_array($badgeData['nitro']) || is_array($badgeData['flash']);
$this->badgeWasPreviouslyCreated = is_array($badgeData['nitro'] ?? null) || is_array($badgeData['flash'] ?? null);
if ($this->badgeWasPreviouslyCreated) {
Notification::make()