Skip to content

Commit

Permalink
Merge pull request #100 from n1crack/dev
Browse files Browse the repository at this point in the history
add escape params to query method
  • Loading branch information
n1crack authored Jun 7, 2024
2 parents ca24a2c + dee253e commit de67860
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Datatables.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,16 @@ public function hide(string $column, $searchable = false): Datatables
* @param mixed $query
* @return Datatables
*/
public function query($query): Datatables
public function query($query, array $escapes = []): Datatables
{
$query = $this->db->getQueryString($query);
$this->builder = new QueryBuilder($query, $this->options, $this->db);
$this->columns = $this->builder->columns();

foreach ($escapes as $key => $value) {
$this->escape($key, $value);
}

return $this;
}

Expand Down

0 comments on commit de67860

Please sign in to comment.