diff --git a/app/Filament/Resources/Document/Page.php b/app/Filament/Resources/Document/Page.php index 49da60b34..2c7ada3eb 100644 --- a/app/Filament/Resources/Document/Page.php +++ b/app/Filament/Resources/Document/Page.php @@ -152,7 +152,7 @@ class Page extends BaseResource ->maxLength(16777215) ->rules(['required', 'max:16777215']) ->columnSpan(2) - ->formatStateUsing(fn (PageModel $record) => $record->body), + ->formatStateUsing(fn (?PageModel $record) => $record?->body), ]) ->columns(2); } diff --git a/app/Models/Wiki/Anime/Theme/AnimeThemeEntry.php b/app/Models/Wiki/Anime/Theme/AnimeThemeEntry.php index 76271775a..458ec1ee7 100644 --- a/app/Models/Wiki/Anime/Theme/AnimeThemeEntry.php +++ b/app/Models/Wiki/Anime/Theme/AnimeThemeEntry.php @@ -172,7 +172,7 @@ class AnimeThemeEntry extends BaseModel implements InteractsWithSchema return Str::of($this->anime->name) ->append(' ') ->append($this->animetheme->type->localize()) - ->append($this->animetheme->type === ThemeType::IN ? '' : strval($this->sequence ?? 1)) + ->append($this->animetheme->type === ThemeType::IN ? '' : strval($this->animetheme->sequence ?? 1)) ->append(empty($this->version) ? '' : "v$this->version") ->append($this->animetheme->group !== null ? '-'.$this->animetheme->group->slug : '') ->__toString(); diff --git a/database/factories/Wiki/Anime/AnimeThemeFactory.php b/database/factories/Wiki/Anime/AnimeThemeFactory.php index ac7393ac4..6ad0dd4ad 100644 --- a/database/factories/Wiki/Anime/AnimeThemeFactory.php +++ b/database/factories/Wiki/Anime/AnimeThemeFactory.php @@ -33,7 +33,7 @@ class AnimeThemeFactory extends Factory */ public function definition(): array { - $type = Arr::random(ThemeType::cases()); + $type = Arr::random([ThemeType::OP, ThemeType::ED]); return [ AnimeTheme::ATTRIBUTE_SEQUENCE => fake()->randomDigitNotNull(),