对不起,我是拉丁裔,我的英语不好。
我在{{apiUrl}}/product?$joinEager=[brand, attributes]&$sort[brand.name]=-1
文件中使用auth
中间人,但是当我尝试从没有登录用户Laravel抛出异常来访问UserController.php
和user/profile_picture
路由时,我无法使用user/bio
例外。
web.php:
The GET method is not supported for this route. Supported methods: POST.
UserController.php:
Route::get("/", function(){
return view('welcome');
});
Route::get('home', 'HomeController@index')->name('home');
Route::get("admin/users/seller_register", "Auth\RegisterController@showSellerRegistrationForm")
->name("users.seller_register_form");
Route::post("admin/users/seller_register", "Auth\RegisterController@sellerRegister")
->name("users.seller_register");
Route::get("admin/users/modal_delete_form", "AdministratorController@modalDeleteForm");
Route::get("admin/users/modal_update_form", "AdministratorController@modalUpdateForm");
Route::get("admin/users/crud_content", "AdministratorController@crudContent");
Route::resource('admin/users', 'AdministratorController');
Route::get("user/profile/{e_mail}", "UserController@profile")->name("user.profile");
Route::post("user/profile_picture", "UserController@profilePicture")->name("user.profilePicture");
Route::post("user/bio", "UserController@bio")->name("user.bio");
Auth::routes(["verify" => true]);
答案 0 :(得分:1)
只需更改这些路线
Route::post("user/profile_picture", "UserController@profilePicture")->name("user.profilePicture");
Route::post("user/bio", "UserController@bio")->name("user.bio");
要...
Route::get("user/profile_picture", "UserController@profilePicture")->name("user.profilePicture");
Route::get("user/bio", "UserController@bio")->name("user.bio");
完成。
答案 1 :(得分:1)
尝试使用get
方法
Route::get("user/profile_picture","UserController@profilePicture")->name("user.profilePicture");
Route::get("user/bio", "UserController@bio")->name("user.bio");