2
這是我的網址:Laravel拋出NotFoundHttpException上的資源
http://serverHost:port/projectName/public/restaurants/create
這是錯誤消息:
Open: UrlToProject\bootstrap\compiled.php
if (!is_null($route)) {
return $route->bind($request);
}
$others = $this->checkForAlternateVerbs($request);
if (count($others) > 0) {
return $this->getOtherMethodsRoute($request, $others);
}
throw new NotFoundHttpException();
}
protected function checkForAlternateVerbs($request)
雖然路線確實存在這樣的:
Route::resource('restaurants', 'RestaurantsController');
和控制器RestaurantsController
有這種方法:
public function create()
{
return View::make('restaurants.create');
}
和視圖絕對存在。請問我做錯了什麼?
我在Windows 7
上Laravel 4.2.3工作的同時,我注意到這些lock
跡象。這是錯的嗎?
你上哪兒去把控制器?你有任何命名空間?在您的控制檯中嘗試'composer dump-autoload'。否則,一定會有筆誤。告訴我們你的控制器代碼 –
@estshy我把控制器放在'controller'文件夾中,並且我已經用'artisan'創建了控制器。另外,不,我沒有嘗試'composer dump-autoload'這是什麼? –
@estshy我試圖在根上執行該命令,然後嘗試調用url併發生相同的錯誤 –