laravel-filament-seo icon indicating copy to clipboard operation
laravel-filament-seo copied to clipboard

how to change style of seo form

Open muhammedfayaz opened this issue 11 months ago • 3 comments

how to add a hint in each input field

muhammedfayaz avatar Mar 25 '24 07:03 muhammedfayaz

Hey @muhammedfayaz, thank you for your message! I'm afraid that that is not yet possible right now, but I am open to a PR that changes the SEO class to this:

class SEO
{
    public static function make(array $only = ['title', 'author', 'description'], Closure $modifyTitleFieldUsing = null, ...): Group
    {
        return Group::make(function (Group $component) use ($modifyTitleFieldUsing) {
            $titleField = TextInput::make('title')
                ->translateLabel()
                ->label(__('filament-seo::translations.title'))
                ->columnSpan(2);

            if ($modifyTitleFieldUsing) {
                $titleField = $component->evaluate($titleField, ['field' => $titleField], [$titleField::class => $titleField]);
            }

          return Arr::only([
              'title' => $titleField,
               // ...
// ...

ralphjsmit avatar Mar 25 '24 10:03 ralphjsmit

I talked about the hint below field not the title

muhammedfayaz avatar Mar 25 '24 11:03 muhammedfayaz

Yes, I just used the title field as example, but you would implement it like this for every other input field, so you can in the end just choose what you want. I don't have time quickly to implement this myself, but as I said I'm open to a PR if you are.

ralphjsmit avatar Mar 25 '24 11:03 ralphjsmit

@ralphjsmit Would it be possible to add something like ->translatable() using the closure?

AlexanderFalkenberg avatar Oct 09 '24 14:10 AlexanderFalkenberg

@AlexanderFalkenberg If this closure functionally is PR'ed (I talked about that I was open for a PR to it), then it would be possible yes, as you could yourself modify the TextInput and other form fields (each field a closure $modify.. closure). Don't have the time to do it myself right now but if you want to PR I'm totally okay.

ralphjsmit avatar Oct 16 '24 06:10 ralphjsmit