Skip to content

I can't pass parameters to the component. #203

Description

@chrisklein00

I can't pass parameters to the component.

I have 3 files:

Inside Livewire/test.blade.php
onclick='Livewire.emit("openModal", "test-modal", {{ json_encode(["id_code" => $client->id_code]) }})'>

Inside /Http/Livewire/TestModal.php

namespace App\Http\Livewire;

use LivewireUI\Modal\ModalComponent;
use App\Models\Client;


class TestModal extends ModalComponent
{
    public $id_code;

    public function render($id_code)
    {
        dd($id_code);
        return view('livewire.test-modal');
    }
}

And livewire.test-modal which displays the content of the modal window.

But I can't get the id_code.

Let's see if someone can help me with this. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions