src/Models/Repository.php
public function newInstanceQuery(array $data = [], array $selectable = ['*'])
    {
        $tm = new TextGenerator();

        $r = $this->newInstanceRepository();
        $query = $r->newQuery();

        if (!empty($this->filter)) {
            $filter = new Filter($r->getTableName(), $selectable);
            $filter->build($query, $tm->generateAndRender($this->filter, $data));
        }

        return $query;
    }
public function newInstanceQuery(array $data = [], array $selectable = ['*'])
    {
        $tm = new TextGenerator();

        $r = $this->newInstanceRepository();
        $query = $r->newQuery();

        if (!empty($this->filter)) {
            $filter = new Filter($r->getTableName(), $selectable);
            $filter->build($query, $tm->generateAndRender($this->filter, $data));
        }

        return $query;
    }
New query instance.

@param array $data
@param array $selectable

@return \Illuminate\Database\Eloquent\Builder