How to group multiple routes with the same controller method?
<p>I have the following in my <code>routes.php</code>:</p>

<pre><code>Route::get('test/foo', 'TestController@index');

Route::get('test/bar', 'TestController@index');

Route::get('test/baz', 'TestController@index');
</code></pre>

<p>and I am trying to reduce this to the following:</p>

<pre><code>Route::get(either 'test/foo' or 'test/bar' or 'test/baz', 'TestController@index');
</code></pre>

<p>One <a href="https://laravel.com/docs/5.2/routing#parameters-regular-expression-constraints" rel="noreferrer">documented approach</a> that would sort of apply here, is to place a regex constraint to the route:</p>

<pre><code>Route::get('test/{uri}','TestController@index')-&gt;where('uri', 'regex for foo, bar, and baz...');
</code></pre>

<p>However, this solution would be ugly. Isn't there an elegant way to just express</p>

<pre><code>{uri} in foo,bar,baz
</code></pre>

<p>in Laravel's language? Otherwise, what would the regex look like?</p>

<p>Thanks!</p>

<p><strong>P.S.</strong> I've read <a href="https://stackoverflow.com/questions/17489492/multiple-routes-in-single-routeget-call-laravel-4/21970797#answer-21970797">this</a>, but it didn't apply to my case with 3 routes.</p>