Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Database\Concerns;
4
 
5
use Illuminate\Support\Collection;
6
 
7
trait ExplainsQueries
8
{
9
    /**
10
     * Explains the query.
11
     *
12
     * @return \Illuminate\Support\Collection
13
     */
14
    public function explain()
15
    {
16
        $sql = $this->toSql();
17
 
18
        $bindings = $this->getBindings();
19
 
20
        $explanation = $this->getConnection()->select('EXPLAIN '.$sql, $bindings);
21
 
22
        return new Collection($explanation);
23
    }
24
}