Hi, I do not see a problem here though,
From what I can understand is that the id always remains the same.
First, I would recommend you NOT to repeat the modal in a loop rather use a separate blade and include it in the code and use ajax to dynamically change the ids, values etc.
The button that calls the modal, you can bind an onclick event to call a function with $user->id as a parameter to set a hidden field in the form. Also $user->id can be used to get the current user data using ajax to fill the form fields. You should not have a problem there.
I think the issue is in your hidden field. <input class="form-control hidden" type="text" name="id" value="{{ $user->id }}" disabled>
You have defined this with the same name in a loop. At the end, you got the same value as the input name is "id" only. You can use <input class="form-control hidden" type="text" name="ids[]" value="{{ $user->id }}" disabled>
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community