Skip to content

Commit

Permalink
Merge pull request #78 from macbookandrew/bugfix/telescope-logging
Browse files Browse the repository at this point in the history
flatten bindings for Telescope
  • Loading branch information
Smef authored Sep 6, 2024
2 parents c2271d2 + 6fab13a commit 97b91cf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Services/FileMakerConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,16 @@ protected function logFMQuery($method, $url, $params, $start)
$sql .= "\nData: " . json_encode($params, JSON_PRETTY_PRINT);
}

$this->event(new QueryExecuted($sql, Arr::get($params, 'query', []), $this->getElapsedTime($start), $this));
$bindings = collect(data_get($params, 'query', []))->flatMap(
fn (array $binding, $index) => collect($binding)->mapWithKeys(fn ($value, $key) => [$index . ': ' . $key => $value])
)->all();

$this->event(new QueryExecuted(
$sql,
$bindings,
$this->getElapsedTime($start),
$this,
));
}

protected function getSqlCommandType($method, $url)
Expand Down

0 comments on commit 97b91cf

Please sign in to comment.