title: switch route in web.php laravel
body: <p>I've 2 routes in my web.php </p>
  
  <p>1)  <code>Route::get('/{url}', 'MenuController@menu');</code></p>
  
  <p>which provide url :</p>
  
  <ul>
  <li>/menu</li>
  </ul>
  
  <p>2) <code>Route::get('/{name}', 'HomeSlideviewController@index')-&gt;name('promotiondetail');</code></p>
  
  <p>which provide url :</p>
  
  <ul>
  <li>/menu (different page but same name in route 1)</li>
  <li>/food</li>
  </ul>
  
  <p>I want to use 2 route if route = same name I want to use route 1 if route 1 dont have url It will use route 2 . In web.php is their anyway to do something like </p>
  
  <pre><code>if(Route::get('/{url}', 'MenuController@menu')) is null use
  
  `Route::get('/{name}', 'HomeSlideviewController@index')-&gt;name('promotiondetail');`
  </code></pre>
  
  <p>now in my web.php I do this</p>
  
  <pre><code> Route::get('/{url}', 'MenuController@menu');
   Route::get('/{name}', 'HomeSlideviewController@index')-&gt;name('promotiondetail');
  </code></pre>
  
  <p>when I go /food It will go page not found. </p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>In my controller I try this </p>
  
  <pre><code>try {
      // if find url
  }
  } catch (\Exception $e) {
      //if not find url
      return redirect()-&gt;route('promotiondetail', $url);
  }   
  </code></pre>
  
  <p>and It return Error redirected you too many times </p>
  
  <p><strong>UPDATE 3</strong></p>
  
  <p>$url = food</p>