src/RouteSupport.php
/**
     * Adds filters that are not present.
     *
     * @param      $filters
     * @param bool $overwrite Should we overwrite present filter's values with new ones?
     *
     * @return string
     */
Adds filters that are not present.

@return string
Adds filters that are not present . @return string
public function add($filters, bool $overwrite = false): string
    {
        $filters = $this->applicableFilters($filters);
        $request = clone $this->request;
        if (empty($filters)) {
            return $request->fullUrl();
        }
        $queryBag = $request->query;
        foreach (array_keys($filters) as $filter) {
            if ($queryBag->has($filter) && ! $overwrite) {
                unset($filters[$filter]);
            }
        }
        return $request->fullUrlWithNiceQuery(array_merge($queryBag->all(), $filters));
    }
public function add ( $ filters , bool $ overwrite = false ) : string { $ filters = $ this -> applicableFilters ( $ filters ) ; $ request = clone $ this -> request ; if ( empty ( $ filters ) ) { return $ request -> fullUrl ( ) ; } $ queryBag = $ request -> query ; foreach ( array_keys ( $ filters ) as $ filter ) { if ( $ queryBag -> has ( $ filter ) && ! $ overwrite ) { unset ( $ filters [ $ filter ] ) ; } } return $ request -> fullUrlWithNiceQuery ( array_merge ( $ queryBag -> all ( ) , $ filters ) ) ; }
Adds filters that are not present.
Adds filters that are not present .