InvalidArgumentException Route [登錄]未定義
我無法檢測到問題。當我從中間件驗證組中刪除管理面板路線時,它的效果非常好。但是,通過這種路線,它通過這個例外。
這是我的路線文件。
Route::group(['middleware'=>['auth']],function(){
Route::post('/signin','[email protected]')->name("signin");
});
My controller function is :
public function postSignIn(Request $request)
{
$this->validate($request,[
'email' => 'required|email',
'password' => 'required|min:6',
]);
$email = $request['email'];
$user = User::where("email",$email)->first();
if(Auth::attempt(['email' => $request['email'],'password' => $request['password']]))
{
if ($user['verified'] == 1){
if ($user['role'] == 2) {
return redirect()->route('dashboardd');
}
else if($user['role'] == 0 && $user['blocked'] == 1){
$message = 'Your account has been blocked by admin';
return redirect()->back()->with('message',$message);
}else if($user['role'] == 1 && $user['blocked'] == 1){
$message = 'Your account has been blocked by admin';
return redirect()->back()->with('message',$message);
}
else{
return redirect()->route('news-feed');
// return view('frontend.layouts.user_login_layout',compact('posts','comments','keywords','regular'));
}
}
else
{
$message = 'Account not verified! Verify Email to activate your account';
return redirect()->route('home')->with('message',$message);
}
}else{
$message = 'Wrong Credentials , Try Again ! ';
return redirect()->back()->with('message',$message);
}
}
這些路線導致問題。這與管理面板有關。 我擁有管理員和用戶的相同用戶表。當我從組中刪除管理面板路由時,用戶可以完美登錄。但是當我添加這些路線時,用戶不能登錄也不能管理員。
//admin-panel routes
Route::get('importExport', '[email protected]');
Route::post('importExcel', '[email protected]');
Route::post('/logicsubmit','[email protected]')->name("logicsubmit");
Route::get('/RegularUser','[email protected]')->name("RegularUser");
Route::get('/Company','[email protected]')->name("Company");
Route::post('/signup','[email protected]')->name("signup");
Route::post('/companysignup','[email protected]')->name("companysignup");
Route::get('/logout','[email protected]')->name("logout");
Route::get('/dashboardd','[email protected]')->name("dashboardd");
Route::get('/admit','[email protected]')->name("admit");
Route::get('/admin','[email protected]')->name("admin");
Route::get('/admins','[email protected]')->name("admins");
Route::get('/lock', '[email protected]')->name("lock");
Route::post('/adminsignup','[email protected]')->name("adminsignup");
Route::get('/view/{id}','[email protected]')->name("view");
Route::get('/block/{id}','[email protected]')->name("block");
Route::get('/unblock/{id}','[email protected]')->name("unblock");
Route::get('/delete/{id}','[email protected]')->name("delete");
Route::get('/Addkeywords','[email protected]')->name("Addkeywords");
Route::post('/addword','[email protected]')->name("addword");
Route::get('/editword/{id}','[email protected]')->name("editword");
Route::get('/deleteword/{id}','[email protected]')->name("deleteword");
Route::post('/updateword/{id}','[email protected]')->name("updateword");
//end of admin-panel routes
你能後的堆棧跟蹤?此外,突出部分是造成問題。(管理路線,因爲你提到) – jaysingkar
請閱讀[在什麼情況下我可以添加「緊急」或其他類似的短語到我的問題,以獲得更快的答案? .stackoverflow.com/q/326569) - 總結是,這不是解決志願者問題的理想方式,而且可能會對獲得答案產生反作用。請不要將這添加到您的問題。 – halfer
@jaysingkar我更新了我提到的問題。 – DevTaabi