FilamentF
Filament8mo ago
Asmit

How filament component works ?

Hi everyone!
I’m currently tinkering with a custom Filament form field and ran into a bit of confusion.
I tried the following in a Blade file:
<x-filament-forms::text-input />
@include('filament-forms::components.text-input')


The first line (<x-filament-forms::text-input />) throws this error: Undefined variable $getDatalistOptions
But the second line using @include works fine.

I thought Filament form fields are Blade components, so I’m unsure why this is happening.
Here’s the custom field I’m working on:
class NewInput extends TextInput
{
    protected string $view = 'forms.components.new-input';
}


Can someone please explain how Filament renders these components, why this happening and what’s the correct way to use them , especially when customizing or extending?

Thanks in advance!
Was this page helpful?