addColumn
and editColumn
will now load view if it exists. All eloquent/data attributes will be passed as variables on view.
Usage:
Controller
return $datatables
->eloquent($builder)
->addColumn('action', 'admin.users.datatables.action')
->editColumn('active', 'admin.users.datatables.active')
View
/resources/views/admin/users/datatables/action.blade.php
{{ $first_name }} #{{ $id }}
/resources/views/admin/users/datatables/active.blade.php
@if($active)
active
@else
inactive
@endif