public function getallusers() { return Datatable::collection(UserDetails::all(array('id', 'employee_id', 'firstname', 'surname', 'department', 'email')))->searchColumns(array('employee_id', 'firstname', 'surname'))->addColumn('employee_id', function ($model) { return $model->employee_id; })->addColumn('firstname', function ($model) { return ucfirst($model->surname) . ', ' . ucfirst($model->firstname); })->addColumn('department', function ($model) { return $model->department; })->addColumn('email', function ($model) { return $model->email; })->addColumn('action', function ($model) { return "<a href='e_user/" . $model->employee_id . "'class='btn btn-sm btn-success'><i class='fa fa-edit'></i></a>\n\t\t\t\t\t<a href='u_leave/" . $model->employee_id . "'class='btn btn-sm btn-info'><i class='fa fa-refresh'></i></a>\n\t\t\t\t\t<a href='d_user/" . $model->employee_id . "'class='btn btn-sm btn-danger'><i class='fa fa-trash'></i></a>"; })->make(); }