jQuery Datatables and Laravel 6.x Pagination

jQuery DataTables is a table component that is powerful for data management. These plugins provide searching, sorting, pagination, filter per column, and many more. But we have some problems combining jQuery Datatables and Laravel framework.

We separate applications (Rest API and User Interface). For Rest API we use Laravel Framework and for User Interface use Laravel too, but we only Blade component and Guzzle as HTTP Client Library.

We now Laravel has good packages for handle it, as far I know Yajra’s good and incredible packages (you can see Yajra’s package on Github). But using Yajra’s library was not possible at that time, because Yajra was using Eloquent and can’t use HTTP Client (like Guzzle, UniRest, etc). Then we do research to deal with this problem and got results as we would discuss in this post.

On these tutorials, we use an empty Laravel 6.x project with Bootstrap 3, jQuery Datatables plugins. Our goal in this tutorial is to Display User Lists in Datatables (Searching and Sorting also). Ok let’s start the codings. Read More