Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

eloquentdatatable add column

$model = AppUser::query();

return DataTables::eloquent($model)
  		->addColumn('intro', 'Hi {{$name}}!')->toJson();

// OR With closer
return DataTables::eloquent($model)
                ->addColumn('intro', function(User $user) {
                    return 'Hi ' . $user->name . '!';
                })
                ->toJson()
Source by yajrabox.com #
 
PREVIOUS NEXT
Tagged: #eloquentdatatable #add #column
ADD COMMENT
Topic
Name
7+6 =