From c0e3933a72a74e2b081d50c3518f56e5d36af50c Mon Sep 17 00:00:00 2001 From: Steven Richardson Date: Tue, 16 Apr 2024 15:55:32 +0100 Subject: [PATCH] Add character length helper text to title field --- src/SEO.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/SEO.php b/src/SEO.php index e0d3337..2875b02 100644 --- a/src/SEO.php +++ b/src/SEO.php @@ -18,6 +18,13 @@ public static function make(array $only = ['title', 'author', 'description']): G 'title' => TextInput::make('title') ->translateLabel() ->label(__('filament-seo::translations.title')) + ->helperText(function (?string $state): string { + return (string) Str::of(strlen($state)) + ->append(' / ') + ->append(60 . ' ') + ->append(Str::of(__('filament-seo::translations.characters'))->lower()); + }) + ->reactive() ->columnSpan(2), 'author' => TextInput::make('author') ->translateLabel()