feat: implement real-time SEO character counters and improve default avatar handling and translation logic.

This commit is contained in:
Ümit Tunç
2026-08-07 23:25:40 +03:00
parent 32b3f5187d
commit a51af8208d
7 changed files with 91 additions and 5 deletions
@@ -146,12 +146,20 @@ class BlogForm
TextInput::make('meta_title')
->label(__('blog.meta_title_field'))
->maxLength(60)
->extraInputAttributes(['maxlength' => 60])
->live(debounce: 200)
->hint(fn ($state) => mb_strlen((string) $state) . ' / 60')
->hintColor(fn ($state) => mb_strlen((string) $state) > 60 ? 'danger' : 'gray')
->helperText(__('blog.meta_title_helper')),
Textarea::make('meta_description')
->label(__('blog.meta_description_field'))
->rows(3)
->maxLength(160)
->extraInputAttributes(['maxlength' => 160])
->live(debounce: 200)
->hint(fn ($state) => mb_strlen((string) $state) . ' / 160')
->hintColor(fn ($state) => mb_strlen((string) $state) > 160 ? 'danger' : 'gray')
->helperText(__('blog.meta_description_helper'))
->columnSpanFull(),
])
@@ -15,12 +15,20 @@ class SeoSection
TextInput::make('meta_title')
->label(__('pages.meta_title_field'))
->maxLength(60)
->extraInputAttributes(['maxlength' => 60])
->live(debounce: 200)
->hint(fn ($state) => mb_strlen((string) $state) . ' / 60')
->hintColor(fn ($state) => mb_strlen((string) $state) > 60 ? 'danger' : 'gray')
->helperText(__('pages.meta_title_helper_text')),
Textarea::make('meta_description')
->label(__('pages.meta_description_field'))
->rows(3)
->maxLength(160)
->extraInputAttributes(['maxlength' => 160])
->live(debounce: 200)
->hint(fn ($state) => mb_strlen((string) $state) . ' / 160')
->hintColor(fn ($state) => mb_strlen((string) $state) > 160 ? 'danger' : 'gray')
->helperText(__('pages.meta_description_helper_text'))
->columnSpanFull(),
])