WowPress-Tailwind/theme/vendor/illuminate/database/Concerns/ExplainsQueries.php

25 lines
452 B
PHP
Raw Permalink Normal View History

2024-04-15 16:00:49 +02:00
<?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);
}
}