I have never understood how to create proper URLs. Every time I end up with trying to figure out if I should do ?var=value or &var=value and then if ?var=value already exists then I end up with ?var=value&var=value.
For example: I have pagination and my URL could look like this
www.example.com OR www.example.com?name=John
Then my pagination link is href="?page=2" and I end up with
Then I want to navigate to the next page with href="?page=3" and I end up with this. Because it keeps on adding.
What a mess.... is there a function for PHP or Laravel that would create proper URLS? (knowing when to use ? or & and not add existing values all the time but replace them if they exist already.