1
我有路由這樣的情況:Laravel 4更有效的路由?
// Game
Route::get('game/p/{action}', '[email protected]');
Route::get('game/e/{id}', '[email protected]');
Route::post('game/p/add', '[email protected]');
// GameCategory
Route::get('gamecategory/p/{action}', '[email protected]');
Route::get('gamecategory/e/{id}', '[email protected]');
Route::post('gamecategory/p/add', '[email protected]');
// Deposit
Route::get('deposit/p/{action}', '[email protected]');
Route::get('deposit/e/{id}', '[email protected]');
Route::post('deposit/p/update', '[email protected]');
由於可以在這裏看到,該代碼是相當重複的,但某些模塊只使用特定的控制器和他們的路由模式是類似的。
我一直在谷歌搜索,發現Route::resource
可以縮短這一點,但我不知道如何實施它在我的情況。有人能幫我嗎?謝謝
是的這個作品,我怎麼不考慮它?謝謝 – user2002495