You've already forked Epicnabbo-Catalogus-Updated-Daily
🆙 Add more fixes 🆙
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user