Closed lgt closed 10 years ago
This class is designed to handle "Eloquent ORM or Fluent Query Builder" objects (see Readme.md). You use DB::select which is simply a raw database access function.
You must create your query using Query Builder ( http://laravel.com/docs/4.2/queries#selects ) and then use the created object with this class.
Example:
// create query builder object
$users = DB::table('users')->select('name', 'email');
// use it with Datatables class
$output = Datatables::of($users)->make();
The "issues" section of this website is definitly not the place where you should ask the question "how to" use Query Builder... Issues section is for reporting bugs, etc. Please post your question to Stack Overflow or similar. You can put a link to stackoverflow question here if you want us to help you too.
okay thanks, sorry but I did not saw mentioned that I can pass the query to Datatable like that. The query alone is working fine
How would I build my datatable if my query with Laravel DB looks like :