src/Utils/Query.php
public static function captureQueries(\Closure $closure)
    {
        DB::enableQueryLog();
        $closure();
        $logs = DB::getQueryLog();
        return array_map(function ($log) {
            return static::inlineBindings($log['query'], $log['bindings']);
        }, $logs);
    }
public static function captureQueries(\Closure $closure)
    {
        DB::enableQueryLog();
        $closure();
        $logs = DB::getQueryLog();
        return array_map(function ($log) {
            return static::inlineBindings($log['query'], $log['bindings']);
        }, $logs);
    }
public static function captureQueries ( \ Closure $ closure ) { DB :: enableQueryLog ( ) ; $ closure ( ) ; $ logs = DB :: getQueryLog ( ) ; return array_map ( function ( $ log ) { return static :: inlineBindings ( $ log [ 'query' ] , $ log [ 'bindings' ] ) ; } , $ logs ) ; }
Capture SQL queries, called via Eloquent inside argument closure

@param \Closure $closure function, that contains DB invocations
@return array
Capture SQL queries called via Eloquent inside argument closure