为了账号安全,请及时绑定邮箱和手机立即绑定

lavarel找不到控制器如何解决?

lavarel找不到控制器如何解决?

PHP
qq_卡卡_35 2017-10-05 15:36:13
路由是这么写的:Route::get('student/index',['uses' => 'StudentController@index']);控制器StudentController.php<?phpnamespace App\Http\Controller;use App\Http\Controllers\Controller;class StudentController extends Controller{    public function index()    {        return view('student.index');    }}结果提示:Whoops, looks like something went wrong.1/1                            ReflectionExceptionin Route.php line 264:                            Class App\Http\Controllers\StudentController does not exist                        in Route.php line 264atReflectionMethod->__construct('App\Http\Controllers\StudentController', 'index') in Route.php line 264atRoute->signatureParameters('Illuminate\Database\Eloquent\Model') in Router.php line 859atRouter->substituteImplicitBindings(object(Route)) in Router.php line 844atRouter->substituteBindings(object(Route)) in Router.php line 827atRouter->findRoute(object(Request)) in Router.php line 691atRouter->dispatchToRoute(object(Request)) in Router.php line 675
查看完整描述

1 回答

?
qq_卡卡_35

TA贡献1条经验 获得超0个赞

命名空间写错了,应该是namespace App\Http\Controllers;

查看完整回答
反对 回复 2017-10-05
  • 1 回答
  • 0 关注
  • 1986 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信