Hi I'm new to Laravel and trying Laravel 8. In my web app there is a pop up to select a option, the select box is also dynamically populated. I need to fetch some data from the database to a table on the pop up based on the selected option without reloading the page.
The code of the pop up.
<div id="UpgradeStudentModal" class="modal fade" tabindex="-1" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title mt-0" id="myModalLabel">Upgrade Student</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="modal-body">
<form action="" method="post" enctype="multipart/form-data">
{{csrf_field()}}
<div class="mb-3">
<label for="" class="form-label">Teacher</label>
<select class="form-control" name="teacherId">
@foreach($teachers as $teacher)
<option value="{{$teacher->tId}}">{{$teacher->tName}}</option>
@endforeach
</select>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary waves-effect waves-light">Save
</button>
<button type="button" class="btn btn-outline-danger waves-effect waves-light"
data-bs-dismiss="modal">Close
</button>
</div>
</form>
</div>
</div>
</div>
</div>
Sorry but I have no code to describe what I have tried.
This is a screenshot of the pop up.
I need to get a dynamic output like this.
I can edit the question to provide more code as your request, I just don't know what will help right now.

