devsrv / livewire-modal

Turn Laravel Livewire Component into Modal.
MIT License
14 stars 4 forks source link

parameters are not accessible in the mount method #4

Open khurrambaig007 opened 2 years ago

khurrambaig007 commented 2 years ago

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