We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3aae85c commit 7205552Copy full SHA for 7205552
src/DataTables.php
@@ -121,8 +121,9 @@ public function except($columns)
121
protected function setReturnedFieldNames()
122
{
123
if ( ! empty($this->only)) {
124
- foreach ($this->fieldNames as $field) {
125
- if (in_array($field, $this->only)) {
+ // Keep fields order as defined
+ foreach ($this->only as $field) {
126
+ if (in_array($field, $this->fieldNames)) {
127
array_push($this->returnedFieldNames, $field);
128
}
129
0 commit comments