Set other form fields from within a Livewire component as field

How can i set the value of a form field from a livewire component that is inside a form.

 public static function form(Form $form): Form
    {
        return $form
            ->schema([
                Forms\Components\Section::make('')
                    ->compact()
                    ->columnSpan(1)
                    ->columns(2)
                    ->schema([
                         Forms\Components\Livewire::make(LiveSearchComponent::class),

  Forms\Components\TextInput::make('name')
])

//Livewire component
class LiveSearchComponent extends Component
{
    public function render()
    {
        return view('livewire.live-search-component');
    }
}


how do i access the $form inside LiveSearchComponent, i want to set 'name' field from within LiveSearchComponent.

Is there a way to do it?
Was this page helpful?