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')
<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';
}
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!
4 Replies
Dan Harrin
Dan Harrin5w ago
Check the first video in my Laracasts series
Asmit
AsmitOP5w ago
I watched the video, but just to clarify, does that mean Filament form components aren’t Blade components themselves?
Dan Harrin
Dan Harrin5w ago
correct
Asmit
AsmitOP5w ago
Thanks! @Dan Harrin

Did you find this page helpful?