2017-08-04 124 views
1

我試圖使用FTP上傳我的Laravel項目,我做了一個composer更新並將服務器的PHP版本更改爲7.但是我收到了'NotFoundHttpException'錯誤。有人能幫助我嗎?我只是學習Laravel並部署了一個項目。我使用了hostinger。提前致謝。Laravel項目中的'NotFoundHttpException'

對不起,您正在尋找的頁面無法找到。

(1/1)在RouteCollection.php NotFoundHttpException (線179)

在RouteCollection->匹配(對象(請求)) 在Router.php(線548)

在路由器 - > findRoute(對象(請求)) 在Router.php(線527)

在路由器 - > dispatchToRoute(對象(請求)) 在Router.php(線513)

在路由器 - >調度(對象(請求)) 在Kernel.php(線176)

在內核級>照亮\基金會\ HTTP {閉合}(對象(請求)) 在Pipeline.php(第30行)

在Pipeline->照亮\路由{閉合}(對象(請求)) 在TransformsRequest.php(第30行)

在TransformsRequest->手柄(對象(請求),對象(封閉)) in Pipeline.php(line 148)

at Pipeline-> Illuminate \ Pipeline {closure}(object(請求)) 在Pipeline.php(線53)

在Pipeline->照亮\路由{閉合}(對象(請求)) 在TransformsRequest.php(第30行)

在TransformsRequest->處理(對象(請求),對象(封閉))在Pipeline.php (線148)

在Pipeline->照亮\管道{閉合}(對象(請求)) 在Pipeline.php(線53)

at Pipeline-> Illuminate \ Routing {closure}(object(Request)) 在ValidatePostSize.php(第27行)

在ValidatePostSize->手柄(對象(請求),對象(封閉)) 在Pipeline.php(線148)

在Pipeline->照亮\管道{閉合}(對象(請求)) 在Pipeline.php(線53)

在Pipeline->照亮\路由{閉合}(對象(請求)) 在CheckForMaintenanceMode.php(線46)

在CheckForMaintenanceMode-> handle(object(Request),object(Closure)) Pipeline.php(line 148)

at Pipeline-> Illuminate \ Pipeline {closure}(object(Request)) 在Pipeline中。PHP(線53)

在Pipeline->照亮\路由{閉合}(對象(請求)) 在Pipeline.php(線102)

在Pipeline->然後(對象(封閉)) 在Kernel.php(線151)

在內核級> sendRequestThroughRouter(對象(請求)) 在Kernel.php在指數(線116)

在內核級>手柄(對象(請求)) .php(line 53)

<?php 

Route::get('index', function() { 
    return view('index.index'); 
}); 

Route::get('signup', function() { 
    return view('auth.signup'); 
}); 

Route::get('choose-signup', '[email protected]'); 
Route::post('choose-signup', '[email protected]'); 

Route::get('register-emp', function(){ 
    return view('Auth.register-emp'); 
}); 

Route::post('register-emp', '[email protected]'); 

// --- 

Route::get('home', '[email protected]'); 
Auth::routes(); // --- 

// employer 
Route::get('logs', 'Auth\[email protected]'); 
Route::post('logs', 'Auth\[email protected]')->name('logss'); 


Route::get('employer', '[email protected]')->name('emp'); 
// employer 

// *******W O R K E X P E R I E N C E************** 

Route::get('profile', '[email protected]')->middleware('auth'); 
Route::post('profile/add','[email protected]'); 
Route::get('resume', '[email protected]')->middleware('auth'); 
Route::post('resume/{id}', '[email protected]'); 
Route::get('resume/{id}', '[email protected]'); 

// **********E D U C A T I O N*********** 

Route::post('profile/added','[email protected]')->middleware('auth'); 
Route::post('profile/{id}', '[email protected]'); 
Route::get('profile/{id}', '[email protected]'); 

//*********S K I L L S****************** 
Route::post('skill/added','[email protected]')->middleware('auth'); 
Route::post('skill/{id}','[email protected]'); 
Route::get('skill/{id}', '[email protected]'); 


//********* S E M I N A R S****************** 
Route::post('profileaddsem','[email protected]')->middleware('auth'); 
Route::post('seminar/{id}','[email protected]'); 
Route::get('seminar/{id}', '[email protected]'); 

//*********C O N T A C T I N F O****************** 


Route::get('jobseeker-signup', '[email protected]'); 
Route::post('jobseeker-signup', '[email protected]'); 
Route::post('contact/{id}','[email protected]'); 

Route::get('choose-signup2', '[email protected]'); 
Route::post('choose-signup2', '[email protected]'); 



// Route::get('/contact-info', function() { 
//  return view('jobseeker-signup-partials.contact-info'); 
// }); 

// *****************I M A G E *********************** 
Route::post('imgupdate','[email protected]_avatar'); 

// ***************P O S T A J O B************************* 

Route::get('jobsearch', '[email protected]'); 
Route::post('jobsearch', '[email protected]'); 

// ***************e d i t p o s t e d j o b************************ 

Route::post('posted/{id}', '[email protected]'); 
Route::get('posted/{id}', '[email protected]'); 


// ************J O B P O S T****************** 
Route::get('jobpost/{id}','[email protected]'); 
// ****Click Apply********** 
Route::post('jobpost','[email protected]'); 
// ****Click Save********** 
Route::post('save','[email protected]'); 
// ***********delete saved jobs******************* 
Route::post('unsave/{id}','[email protected]'); 

Route::get('applicants','[email protected]'); 

Route::post('pdf','[email protected]'); 


// **************************************** 
Route::get('sendemail', function() { 

    $data = array (
     'name' => 'Hello Email!',  

     ); 

     Mail::send('emails.welcome', $data, function($message){ 

     $message->from('[email protected]','Hello'); 
     $message->to('[email protected]')->subject('Hello'); 
     }); 

    return "Your email has been successfully sent"; 
}); 




Route::get('application', function(){ 
    return view('index.application'); 
}); 
Route::get('messages', function(){ 
    return view('index.messages'); 
}); 


// ***********E M P L O Y E R*********************** 

Route::get('employer-signup', '[email protected]'); 
Route::post('employer-signup', '[email protected]'); 


// Route::get('company-profile', '[email protected]'); 
Route::post('employer/post', '[email protected]'); 



// Route::prefix('employer')->group(function(){ 


//  Route::get('/login', 'Auth\[email protected]')->name('employer.login'); 
//  Route::post('/login', 'Auth\[email protected]')->name('employer.login.submit'); 
//  Route::get('/', '[email protected]')->name('company-profile'); 
// }); 



// Route::get('/login', function() { 
//  return view('auth.login'); 
// }); 

// Route::get('/jobseeker-signup', function() { 
//  return view('auth.jobseeker-signup'); 
// }); 
// Route::get('/company-profile', function(){ 
//  return view('index.company-profile'); 
// }); 


// Route::get('post', '[email protected]'); 
+0

你能檢查預定航線在航線列表/認沽web.php的代碼web.php –

+0

,什麼是錯的^^ –

+0

並與URL您嘗試訪問,你會得到錯誤的時候?你更新問題,請發表評論,我們會看到你更新它! –

回答

1

根據你的評論'嗨,這裏是我的項目的網址....',你嘗試訪問的路線是'/'。通過瀏覽你的路線文件,這不存在。

我試過http://cathumali.890m.com/index,這指出我看起來像一個頭版。如果這是預期的頁面,我會建議添加另一條路徑,指向同一個控制器或將路由固定到所有指向索引的點。

Route::get('/', function() { 
    return view('index.index'); 
}); 
+0

嗨,感謝您的幫助,原來,我的路線是這樣寫的, Route :: get('/ index',function(){ return view('index.index'); }); 我刪除了'/'因爲基於我的谷歌研究,我應該刪除它。我想我的路線有問題。謝謝。 – Cath

+0

如果我的答案解決了問題,您可以標記答案。謝謝 – mbozwood

+0

是的,再次感謝.. – Cath

0

編輯:作爲mbozwood在評論中說:兩路相同的URL可以用兩種不同的方法存在。


,如果你真的可以創建兩個途徑與相同的URL,但不同的方法(GET和POST),像這樣的人,我不知道:

Route::get('choose-signup', '[email protected]'); 
Route::post('choose-signup', '[email protected]'); 

相反,使用

Route::match(['get', 'post'], 'choose-signup', '[email protected]'); 

並在您的控制器方法中:

public function signup(Request $request) 
{ 
    if ($request->isMethod('post')) 
    { return redirect()->action('[email protected]', ['request' => $request]); } 
    else 
    { return redirect()->action('[email protected]'); } 
} 

它不是問題,但它是安靜的奇怪。

+1

只要方法不相同,路由可以具有相同的URL。 (Route)::'('service-log',.....);' – mbozwood

+1

'我不知道, 很高興知道! – iArcadia

+0

嗨,謝謝你的幫助,這對我來說是新的。我想我可以在我的下一個項目中使用它。謝謝 – Cath