Laravel 5:Guump with Chumper Datatable

时间:2015-05-05 14:51:51

标签: laravel datatable guzzle

我想知道是否有办法将其与guzzle整合?我在呼唤一个外在的宁静的api。我是Datatable的新手,所以不确定是否可能。现在我只是在我看来做一个foreach。如何将其与chumper datatable集成?

控制器

public function getIndex() {
    $client = new \GuzzleHttp\Client();
    $response = $client->get('http://api.company.com/members');
    $body = json_decode($response->getBody());
    $content = view('members')->with('members',$body);
    return Admin::view($content, 'Members');
}

查看

@foreach ($members as $member)
    <tr>
        <td>{{ $member->name }}</td>
        <td>{{ $member->email }}</td>
        <td>{{ $member->phone }}</td>
    </tr>
@endforeach

0 个答案:

没有答案