How to generate a url with Laravel's url generator helper with parameters that are not at the end?
<p>Normally it is very simple to add parameters using the Laravel <code>url</code> helper method -- as simple as:</p>

<pre><code>url("foo/show/", [333]); // site.com/foo/show/333
</code></pre>

<p>However, how do you do it when parameters are at a midpoint, such as:</p>

<pre><code>url("foo/?/bar/?/show", [333,444]); 
</code></pre>

<p>I have tried the following which all fail (some come close though):</p>

<pre><code>url("foo/?/bar/?/show", [333,444]); 
// site.com/foo//333/444?/bar/?/show

url("foo/{a}/bar/{b}/show", [333,444]);
// site.com/foo/{a}/bar/{b}/show/333/444

url("foo/{a}/bar/{b}/show", ['a' =&gt; 333, 'b' =&gt; 444]);
// site.com/foo/{a}/bar/{b}/show/333/444
</code></pre>

<p>The <code>?</code> is obviously important, because it gets close to the result... </p>

<h3>Note</h3>

<p>I am specifically talking about unnamed routes. So the <code>route</code> function is not in question. Named routes aren't possible in the current project, so I need to reiterate I am looking for the use of the <code>url</code> method. </p>

<p>I 100% agree that normally named routes are the way to go. </p>