Skip to content

Commit

Permalink
Add character length helper text to title field
Browse files Browse the repository at this point in the history
  • Loading branch information
richdynamix committed Apr 16, 2024
1 parent 2e8a3e5 commit c0e3933
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/SEO.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit c0e3933

Please sign in to comment.