Skip to content

Commit

Permalink
Merge pull request #18 from anhofmann/patch-3
Browse files Browse the repository at this point in the history
Don't add "?" to URL if $queryParameters is empty
  • Loading branch information
amenk authored Mar 21, 2024
2 parents 3a40c4b + faee63c commit 5b75ebd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/UrlGeneratorService.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ private function addSid(string $url, ?\Illuminate\Routing\Route $route = null):

// Rebuild the URL
$url = str_replace('?' . $queryString, '', $url);
$url .= '?' . http_build_query($queryParameters);
if(!empty($queryParameters)) {
$url .= '?' . http_build_query($queryParameters);
}

return $url;
}
Expand Down

0 comments on commit 5b75ebd

Please sign in to comment.