2016-04-21 22 views
2

將我的Laravel站點上載到生產服務器後,出現錯誤。方法[guestMiddleware]不存在

BadMethodCallException in Controller.php line 103: 
Method [guestMiddleware] does not exist. 

我對從何處開始調試應用程序感到不知所措。在不需要Auth的頁面上,它們加載正常。

任何意見將不勝感激。

回答

0

您是否定義了guestMiddleware?

+0

它只是標準Laravel驗證文件和文件是完全一樣的正常工作dev的服務器拉? – jhodgson4

+0

你上傳了kerner.php嗎? – Solution

+0

它只是從git回購拉。所有文件完全相同 – jhodgson4

2

變化$this->guestMiddleware()到「客戶」

public function __construct() 
{ 
    //$this->middleware($this->guestMiddleware(), ['except' => 'logout']);  
    //You can see the example here https://laravel-china.org/docs/5.3/controllers 
    $this->middleware('guest', ['except' => 'logout']); 
}