I'm really new to MVC hope you can give me a detailed instructions on this.
I have a query in my repository that returns pending users who have a certain role_id. Now my issue is this I when the administrator clicks on the anchor tag of id idMessenger
below
<li> <a href="#" id="idMessenger">Messenger<span class="label label-danger pull-right">{{$messenger->count()}}</span></a> </li>
I want to show the pending messengers only in the
<div class="col-md-2 left-aside">
<div class="scrollable">
<ul class="inbox-nav capitalize-font">
<li><a href="#" id="all-pending">All Pending Applications</a> </li>
<li><a href="#" id="idClient">Clients<span class="label label-danger pull-right">{{$elderly->count()}}</span></a></li>
<li> <a href="#" id="idMessenger">Messenger<span class="label label-danger pull-right">{{$messenger->count()}}</span></a> </li>
</ul>
</div>
</div>
<!-- /.left-aside-column-->
<div class="col-md-10 right-aside">
<div class="scrollable">
<div class="table-responsive">
<table id="datable_1" class="table display table-hover contact-list" data-page-size="10">
<thead>
<tr>
<th>Appication ID</th>
<th>Name</th>
<th>Email</th>
<th>Senior Citizen Number</th>
<th>Role/Submitted as</th>
<th>Date of Submission</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@foreach($allPending as $user)
<tr>
<td>{{$user->id}}</td>
<td>{{$user->name}}</td>
<td>{{$user->email}}</td>
<td>{{$user->scn}}</td>
<td><span class="label label-danger">{{$user->roles->name}}</span></td>
<td>{{$user->created_at}}</td>
<td>
<a href="{{route('approveUser', $user->id)}}" class="text-inverse" title="Approve" data-toggle="tooltip"><i class="fa fa-check"></i>Approve</a>
</td>
<td>
<a href="{{route('deleteUser', $user->id)}}" title="Delete" data-toggle="tooltip"><i class="fa fa-trash"></i>Delete</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
Can you please teach me how to do it in ajax.