我有
Route::get('/layouttest/{category}/{brand}',
array('as' => 'main', 'uses' => 'MainController@showUrls'))
->where(array('category' => '[0-9]+', 'brand' => '[0-9]+'));
哪个工作正常。但我想要一条路由来捕获其他获取请求/layouttest/
。例如 when{category}
和{brand}
failed->where
条件,或者当它们都没有提供时。我什至无法让它工作,(我已经将 if 放在 routes.php 中的上述路由之后,因为):
Route::get('/layouttest/',
array('as' => 'index', 'uses' => 'MainController@index'));
当我请求时,/layouttest/
我得到一个NotFoundHttpException
.