我在laravel 5.8中尝试了Yajra数据表。它显示出如下错误:
“ message”:“方法Yajra \ DataTables \ CollectionDataTable :: rawColumn 不存在。”
如果有人可以帮助我,我在这里面临问题。
谢谢
public function index()
{
if (request()->ajax()) {
return datatables()->of(Lead::latest()->get())
->addColumn('action',function($data){
$button = '<button type="button" name="edit" id="'.$data->id.'" class="edit btn btn-primary btn-sm">Edit</button>';
$button .= ' ';
$button .= '<button type="button" name="delete" id="'.$data->id.'" class="delete btn btn-danger btn-sm">Delete</button>';
return $button;
})
->rawColumn(['action'])
->make(true);
}
return view('leads');
}