✏️ 编辑:Query.php
路径:
/home/boguraj1/.trash/vendor/facade/ignition/src/QueryRecorder/Query.php
大小:1.34 KB · 修改:2026-07-23 16:13:46 · 权限:0644 · 可写
← 返回目录
👁 查看
⬇ 下载
<?php namespace Facade\Ignition\QueryRecorder; use Illuminate\Database\Events\QueryExecuted; class Query { /** @var string */ protected $sql; /** @var float */ protected $time; /** @var string */ protected $connectionName; /** @var null|array */ protected $bindings; /** @var float */ protected $microtime; public static function fromQueryExecutedEvent(QueryExecuted $queryExecuted, bool $reportBindings = false) { return new static( $queryExecuted->sql, $queryExecuted->time, $queryExecuted->connectionName ?? '', $reportBindings ? $queryExecuted->bindings : null ); } protected function __construct( string $sql, float $time, string $connectionName, ?array $bindings = null, ?float $microtime = null ) { $this->sql = $sql; $this->time = $time; $this->connectionName = $connectionName; $this->bindings = $bindings; $this->microtime = $microtime ?? microtime(true); } public function toArray(): array { return [ 'sql' => $this->sql, 'time' => $this->time, 'connection_name' => $this->connectionName, 'bindings' => $this->bindings, 'microtime' => $this->microtime, ]; } }
💾 保存
取消
保存为 UTF-8,换行统一为 LF