public function appendToQueryString(Request $request, $name, $value)
    {
        $queryString = '?';
        $query = $request->query->all();
        $query[$name] = $value;
        $parametersCount = count($query);
        $count = 1;

        foreach ($query as $parameterName => $parameterValue) {
            $queryString .= $parameterName . '=' . $parameterValue;

            if ($count != $parametersCount) {
                $queryString .= '&';
            }
            $count++;
        }
        return $queryString;
    }
public function appendToQueryString(Request $request, $name, $value)
    {
        $queryString = '?';
        $query = $request->query->all();
        $query[$name] = $value;
        $parametersCount = count($query);
        $count = 1;

        foreach ($query as $parameterName => $parameterValue) {
            $queryString .= $parameterName . '=' . $parameterValue;

            if ($count != $parametersCount) {
                $queryString .= '&';
            }
            $count++;
        }
        return $queryString;
    }
public function appendToQueryString ( Request $ request , $ name , $ value ) { $ queryString = '?' ; $ query = $ request -> query -> all ( ) ; $ query [ $ name ] = $ value ; $ parametersCount = count ( $ query ) ; $ count = 1 ; foreach ( $ query as $ parameterName => $ parameterValue ) { $ queryString .= $ parameterName . '=' . $ parameterValue ; if ( $ count != $ parametersCount ) { $ queryString .= '&' ; } $ count ++ ; } return $ queryString ; }
Append a named value in request query string

@param Request $request
@param $name
@param $value
@return string
Append a named value in request query string