Laravel でいくつかのルートの問題があります。いい方法を取っていないからだと思いますが…
これが私のコードです:
Route::group(array('prefix' => 'products'), function()
{
Route::get('', array('uses'=>'products@index'));
//show all the products
Route::get('{Categorie}',array('uses'=>'products@categorie'))->where('Categorie','^[A-Z][a-z0-9_-]{3,19}$');
//show the products of this categorie
Route::get('{shopname}',array('uses'=>'products@shopname'))->where('shopname','^[a- z][a-z0-9_-]{3,19}$');
//show the product of this shopname
});
Route::group(array('prefix' => '/products/{:any}'), function()
{
//no index because productName is not optionnal
Route::get('{productName}', array('uses'=>'product@getProduct'));
//the Product controller is now SINGULAR
//show this product in particular
});
したがって、最初のグループで機能しています... mysite.fr/products => ok mysite.fr/MyCategory => ok mysite.fr/mashopname => ok
しかし、次のような2番目のパラメーターを追加すると:
mysite.fr/products/myshopname/myfirstproduct
特定のメッセージなしでエラーが発生しました...
助けてくれてありがとう!