Created
March 10, 2019 06:13
-
-
Save omegachien/35eec1e952fc54595ed389e610f8e06d to your computer and use it in GitHub Desktop.
DataTable Example - Book Controller - Load Data via Ajax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use Yajra\DataTables\DataTables; | |
class BookController extends Controller | |
{ | |
public function index() | |
{ | |
return view('book.index'); | |
} | |
public function query() | |
{ | |
return Datatables::of(\App\Book::query()) | |
->make(true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice