Skip to content

parameters are not accessible in the mount method #4

@khurrambaig007

Description

@khurrambaig007

hi, I am trying to pass the parameters to the modal, but in mount method of modal component I get the following error

Illuminate\Contracts\Container\BindingResolutionException
Unable to resolve dependency [Parameter #0 [ $args ]] in class App\Http\Livewire\Contact\EditModel (View: D:\laragon\www\sms-livewire\vendor\devsrv\livewire-modal\resources\views\livewire\modal.blade.php)

<x-livewiremodal-trigger class="btn" title="Edit Contact" modal="contact.edit-model" :args="['id' => '{{ $chat_list_id }}']"> <i class="fa-solid fa-user-pen fa-xl"></i> </x-livewiremodal-trigger>

and in my EditModel Component class in mount method i am accept the $args parameter

public function mount($args){ dump($args); }

please help me with this issue.

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions