2017-09-05 70 views
1

你好我面對NotFoundHttpException錯誤,當我訪問/登錄/註冊 當我運行PHP的人員化妝:auth命令,路線也創造了他們,但/登錄/註冊沒有工作對我來說,讓我跟大家分享我的代碼。NotFoundHttpException在RouteCollection.php(線179)在Laravel 5.4

Web.php

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

當我檢查我的browers檢測控制檯其顯示此錯誤

GET http://localhost/laravel5authprc/login 404(未找到)

回答

0

也許事情是NotFoundHttp ...

我建議:

嘗試:

Route::group([ 'prefix' => 'laravel5authprc' ], function() { 

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


}); 
+1

相同的答案低於,這是沒問題的,你寫他會得到這樣的網址是什麼:本地主機/ laravel5authprc/laravel5authprc /登入... – Sletheren

+0

它也正在'路線::組([「前綴」 =>「laravel5authprc」] ,function(){Auth :: routes。{Auth :: routes} (); Route :: get('/ home','HomeController @ index') - > name('home'); 路線::得到( '/', '的HomeController @指數') - >名稱( 'home.alias'); });'你能解釋我點燃這一點,因爲我是laravel新手? –

1

嘗試訪問http://localhost/laravel5authprc/index.php/login 如果成功,那麼你需要建立一個虛擬主機在Apache虛擬主機文件

+0

這是工作可以請你解釋我這點點,我是laravel新? –

+0

是的!問題是,當你訪問http://本地主機/ laravel5authprc /沒有一個虛擬主機,它只會進入該項目的內容,那麼你手動去公用文件夾通過這樣做,laravel執行index.php文件並啓動應用程序。因爲否則它會認爲根文件夾是http://本地主機/ laravel5authprc /但實際上,它是http://本地主機/ laravel5authprc /大衆,所以要解決它,你必須要告訴你的網絡服務器(Apache)的訪問http ://本地主機/ laravel5authprc /公共當你輸入http://本地主機/ laravel5authprc /文件夾,希望其立即清除 – Sletheren

+0

如果沒有工作@UmairMehmoodKhanLodhi那麼你可以給予好評,並選擇答案,謝謝 – Sletheren

相關問題