Allow longer blog post excerpts
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-22 15:10:50 +01:00
parent 446eb15c6b
commit ad0e8b7923
2 changed files with 43 additions and 4 deletions

View File

@@ -79,9 +79,10 @@ class PostResource extends Resource
->label('Inhalt') ->label('Inhalt')
->required() ->required()
->columnSpanFull(), ->columnSpanFull(),
TextInput::make('excerpt.de') Textarea::make('excerpt.de')
->label('Auszug') ->label('Auszug')
->maxLength(255), ->maxLength(65535)
->columnSpanFull(),
TextInput::make('meta_title.de') TextInput::make('meta_title.de')
->label('Meta-Titel') ->label('Meta-Titel')
->maxLength(255), ->maxLength(255),
@@ -99,9 +100,10 @@ class PostResource extends Resource
MarkdownEditor::make('content.en') MarkdownEditor::make('content.en')
->label('Inhalt') ->label('Inhalt')
->columnSpanFull(), ->columnSpanFull(),
TextInput::make('excerpt.en') Textarea::make('excerpt.en')
->label('Auszug') ->label('Auszug')
->maxLength(255), ->maxLength(65535)
->columnSpanFull(),
TextInput::make('meta_title.en') TextInput::make('meta_title.en')
->label('Meta-Titel') ->label('Meta-Titel')
->maxLength(255), ->maxLength(255),

View File

@@ -0,0 +1,37 @@
<?php
namespace Tests\Unit;
use App\Filament\Blog\Resources\PostResource;
use Filament\Forms\Components\Textarea;
use Filament\Schemas\Concerns\InteractsWithSchemas;
use Filament\Schemas\Contracts\HasSchemas;
use Filament\Schemas\Schema;
use Livewire\Component;
use Tests\TestCase;
class BlogPostExcerptFieldTest extends TestCase
{
public function test_excerpt_fields_allow_long_text(): void
{
$livewire = new class extends Component implements HasSchemas
{
use InteractsWithSchemas;
public function render(): string
{
return '';
}
};
$schema = PostResource::form(Schema::make($livewire));
$excerptDe = $schema->getComponentByStatePath('excerpt.de');
$excerptEn = $schema->getComponentByStatePath('excerpt.en');
$this->assertInstanceOf(Textarea::class, $excerptDe);
$this->assertInstanceOf(Textarea::class, $excerptEn);
$this->assertSame(65535, $excerptDe->getMaxLength());
$this->assertSame(65535, $excerptEn->getMaxLength());
}
}