Illuminate\Database\Query\Builder::addDynamic PHP Method

addDynamic() protected method

Add a single dynamic where clause statement to the query.
protected addDynamic ( string $segment, string $connector, array $parameters, integer $index ) : void
$segment string
$connector string
$parameters array
$index integer
return void
    protected function addDynamic($segment, $connector, $parameters, $index)
    {
        // Once we have parsed out the columns and formatted the boolean operators we
        // are ready to add it to this query as a where clause just like any other
        // clause on the query. Then we'll increment the parameter index values.
        $bool = strtolower($connector);
        $this->where(Str::snake($segment), '=', $parameters[$index], $bool);
    }