Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

174
Visualizações
Livewire component into another livewire component

I have a livewire overview component that contains a couple of cards. In those cards there is a livewire form, however when I include the form into the overview component my entire livewire stops working..

The only line that I am adding into my overview component file is this:

@livewire('apply-form')

When I remove that livewire method everything works fine again, but I need that form in my overview component also..

Is there anything I am doing wrong, or can someone help me out with this strange 'bug'?

Don't know my livewire version, but assets are out of date.

There is also no error(s) given by livewire.

Main component where we include the other component that crashes the rest

Code of the livewire component that crashes the rest:


namespace App\Http\Livewire;

use Illuminate\Support\Facades\Mail;
use Livewire\Component;
use App\Mail\ApplyMail;
use Livewire\WithFileUploads;

class ApplyForm extends Component
{
    use WithFileUploads;

    public $voornaam;
    public $achternaam;
    public $woonplaats;
    public $geboortedatum;
    public $emailadres;
    public $telefoonnummer;
    public $vacaturenaam;
    public $cv;

    protected $rules = [
        'voornaam' => 'required|max:10',
        'achternaam' => 'required|max:10',
        'woonplaats' => 'required|max:10',
        'geboortedatum' => 'required|date',
        'emailadres' => 'required|e-mail',
        'telefoonnummer' => 'required|numeric',
        'vacaturenaam' => 'required',
        'cv' => 'required|mimes:pdf'
    ];

    public function submit()
    {
        $validated = $this->validate();

        $cvRandom = rand(1, 9999999) . '.pdf';

        // Upload cv
        $this->cv->storeAs('cvs', $cvRandom);

        Mail::to('info@nlconnekt.nl')->send(new ApplyMail([$validated, $cvRandom]));

        // Reset the values after a form submit
//        $this->voornaam = '';
//        $this->achternaam = '';
//        $this->woonplaats = '';
//        $this->geboortedatum = '';
//        $this->emailadres = '';
//        $this->telefoonnummer = '';

        return session()->flash('message', 'Bedankt voor uw sollicitatie. Wij nemen z.s.m contact met u op');
    }

    public function render()
    {
        return view('livewire.apply-form');
    }
}
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Try adding a key to that livewire component as suggested in the documentation when nesting components

@livewire('apply-form', ['vacaturnaam' => $vacancy->title], key($vacancy->id))
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda