Skip to content

Commit ff4ef09

Browse files
authored
Fix getting raw bindings from Eloquent builder object
1 parent f2adbac commit ff4ef09

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/yajra/Datatables/Datatables.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,11 @@ private function count()
333333
$myQuery->select($this->connection->raw("'1' as row_count"));
334334
}
335335

336-
$bindings = $myQuery->getRawBindings();
336+
if ($myQuery instanceof QueryBuilder) {
337+
$bindings = $myQuery->getRawBindings();
338+
} else {
339+
$bindings = $myQuery->getQuery()->getRawBindings();
340+
}
337341
unset($bindings['select']);
338342
$bindings = array_flatten($bindings);
339343

0 commit comments

Comments
 (0)