weixin_33720078 2017-01-23 05:56 采纳率: 0%
浏览 15

Ajax在Laravel上获取数据

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.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Python爬取指定微博话题下的内容,保存为txt
    • ¥15 vue2登录调用后端接口如何实现
    • ¥65 永磁型步进电机PID算法
    • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
    • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
    • ¥15 如何处理复杂数据表格的除法运算
    • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
    • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
    • ¥15 latex怎么处理论文引理引用参考文献
    • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?