Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nillegal's avatar

Get value of Child Components directly from Parent Component

Hello everyone, This is a simplied version of what I'm trying to do, just a similar case:

  • I have two child Livewire components, let's call them Name and Email for example
  • I have a main component called Main

What I'm trying to achieve is to regroup both Name and Email components in the Main component. I now have this in my blade file of Main:

<div>
    <form wire:submit.prevent='submit'>
        @livewire('name')
        @livewire('email')
        <button type="submit">DD</button>
    </form>
</div>

but when I click the Submit button that triggers the submit() method of the Main component, the values of both Name and Email are null.

This is what I have in Namecomponent:

    public function form(Form $form): Form
    {
        return $form->schema([
            TextInput::make('name')
        ]);
    }

    public function emitNameValue($value)
    {
        $this->emitUp('nameValue', $value);
    }

and this is my Email component:

    public function form(Form $form): Form
    {
        return $form->schema([
            TextInput::make('email')
        ]);
    }

    public function emitEmailValue($value)
    {
        $this->emitUp('emailValue', $value);
    }

Is there anything I missed? Thank you for your help.

0 likes
1 reply

Please or to participate in this conversation.