//路由格式 Route::Http Method('地址','控制器@方法'); 把该地址的HTTP METHOD请求映射到控制器@方法里面去
// Route::any('地址','控制器@方法'); 把该地址的所有Http Method 请求映射到控制器@方法里面去
// Route::match(['Http Method1','Http Method2',....],'控制器@方法'); 把指定的Http Method 请求映射到控制器@方法里面去
//主页
Route::get('/','HomeController@indexPage');
//用户和管理员
//Route::get('/user/auth/sign-up','UserAuthController@signUpPage');
//Route::post('/user/auth/sign-up','UserAuthController@signUpProcess');
//Route::get('/user/auth/sign-in','UserAuthController@signInProcess');
//Route::post('/user/auth/sign-in','UserAuthController@signInProcess');
//Route::get('/user/auth/sign-out','UserAuthController@signOut');
Route::group(['prefix' => 'user'],function(){
Route::group(['prefix'=>'auth'],function(){
Route::get('/sign-up','UserAuthController@signUpPage');
Route::post('/sign-up','UserAuthController@signUpProcess');
Route::get('/sign-in','UserAuthController@signInProcess');
Route::post('/sign-in','UserAuthController@signInProcess');
Route::get('/sign-out','UserAuthController@signOut');
});
});
//商品
//Route::get('/merchandise','MerchandiseController@merchandisePage');
//Route::post('/merchandise/create','MerchandiseController@merchandiseCreateProcess');
//Route::get('/merchandise/manage','MerchangediseController@merchandiseManagePage');
//Route::get('/merchandise/{merchandise_id}','MerchandiseController@merchandiseItemPage'); //商品详情页面
//Route::get('merchandise/{merchandise_id}/edit','MerchandiseController@merchandiseItemEditPage');
//Route::put('/merchandise/{merchandise_id}','MerchandiseController@merchandiseItemUpdateProcess');
//Route::post('/merchandise/{merchandise_id}/buy','MerchandiseController@merchandiseItemBuyProcess');
Route::group(['prefix' => 'merchandise'],function(){
Route::get('/','MerchandiseController@merchandisePage');
Route::post('/create','MerchandiseController@merchandiseCreateProcess');
Route::get('/manage','MerchangediseController@merchandiseManagePage');
Route::group(['prefix' => '{merchandise_id}'], function(){
Route::get('/','MerchandiseController@merchandiseItemPage'); //商品详情页面
Route::get('/edit','MerchandiseController@merchandiseItemEditPage');
Route::put('/','MerchandiseController@merchandiseItemUpdateProcess');
Route::post('/buy','MerchandiseController@merchandiseItemBuyProcess');
});
});
//交易
Route::get('/transaction','TransactionController@transactionListPage');
在写了路由后可以使用
php artisan route:list
来查看当前的路由设置表