haizone
1 year ago

fullUrlWithQuery didnt work current

Posted 1 year ago by haizone

i use that function fullUrlWithQuery

like that:

<a href="{{request()->fullUrlWithQuery([$field->id => $val])}}">

in the first time its get good Query like this:

http://localhost:8000/category/tv?53=Smart+TV

anat thet my $field->id jts 53 and its good

now i whant to add to that Query more params

but i get wrong $field->id in that function and its start with 0 and i need to get other number

if i look at the same link i get that:

http://localhost:8000/category/tv?0=Smart+TV&1=Smart+TV

its start with 0 and the send param its 1 but its need to be 53 like that:

http://localhost:8000/category/tv?53=Smart+TV&53=Smart+TV

id i print my $field->id i get 53, but only in the fullUrlWithQuery() function at the second time i get wrong numbersID why its append?

                          <a href="{{request()->fullUrlWithQuery([$field->id => $val])}}">
                                {{$val}} - {{$field->id}} - {{request()->fullUrlWithQuery([$field->id => $val])}}
                            </a>

i get that result:

Smart TV - 53 - http://localhost:8000/category/tv?0=Smart+TV&1=Smart+TV

Please sign in or create an account to participate in this conversation.