我正在从 L3 迁移到 L4。注册HomeController
默认 L4 安装附带的控制器时,尝试转到该页面www.domain.com/home
会给我一个ResourceNotFound
例外。我做了一个composer dumpautoload
,但没有帮助。
我错过了一个额外的步骤吗?
路由.php
Route::controller('home', 'HomeController');
控制器/HomeController.php
<?php
class HomeController extends BaseController {
public function showWelcome()
{
return View::make('hello');
}
}
错误堆栈跟踪
NotFoundHttpException:
in /var/www/l4/vendor/laravel/framework/src/Illuminate/Routing/Router.php line 1338
at Router->handleRoutingException(object(ResourceNotFoundException)) in /var/www/l4/vendor/laravel/framework/src/Illuminate/Routing/Router.php line 992
at Router->findRoute(object(Request)) in /var/www/l4/vendor/laravel/framework/src/Illuminate/Routing/Router.php line 956
at Router->dispatch(object(Request)) in /var/www/l4/vendor/laravel/framework/src/Illuminate/Foundation/Application.php line 463
at Application->dispatch(object(Request)) in /var/www/l4/vendor/laravel/framework/src/Illuminate/Foundation/Application.php line 448
at Application->run() in /var/www/l4/public/index.php line 51