/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
src/Illuminate/Database/Concerns/ExplainsQueries.php
24 строки
452 B
Illia Sakovich
[8.x] Add `explain()` to Query\Builder and Eloquent\Builder (#34969)
26 окт 2020, 18:45
Не верифицирован
26 окт 2020, 18:45
c393ca2
Код
Авторство
О чём код?
<?php namespace Illuminate\Database\Concerns; use Illuminate\Support\Collection; trait ExplainsQueries { /** * Explains the query. * * @return \Illuminate\Support\Collection */ public function explain() { $sql = $this->toSql(); $bindings = $this->getBindings(); $explanation = $this->getConnection()->select('EXPLAIN '.$sql, $bindings); return new Collection($explanation); } }