Hi @jgonsuron
I’d add a public $selectedUser to your component do you can then pass the corresponding user to the showModal method:
< div wire:click="showModal($user)" :users="$user" :key="$user" class="cursor-pointer">
{{ $user->name }}
</div>
Then at the showModal method:
public function showModal($user)
{
$this->selectedUser = $user;
$this->modalFormVisable = true;
}
And finally you reference the selectedUser at your modal:
<x-jet-dialog-modal wire:model="modalFormVisable">
<x-slot name="title">
{{ $selectedUser->name }}
</x-slot>
<x-slot name="content">
<div class="mt-4">
<img src="{{ $selectedUser->profile_photo_url }}" alt="{{ $selectedUser->name }}'s Profile picture" class="rounded-full h-10 w-10 object-cover mr-2">
</div>
</x-slot>
Hope this works!!
You’ll probably have to do some adjustsments tho, as I’m writing this from my phone so I’m sure there must be some typos