Container.php第719行中的ReflectionException:类绑定不存在

时间:2017-04-02 09:36:27

标签: php laravel-5.2 laravel-5.3

最近我正在使用laravel 5.4(我之前使用laravel 5.2)来完成一个项目。我的 api.php

中有简单的路线
Route::get('/test', function () {
return "test";
});

当我尝试使用网址 / api / test 邮递员访问此网址时,出现以下错误 -

ReflectionException in Container.php line 719:
Class bindings does not exist

laravel 5.2 中使用api时,我没有遇到这种错误。现在我被困在这里。希望有人有解决方案,谢谢。

1 个答案:

答案 0 :(得分:0)

但是,在我的情况下,我在其中找到解决方案的地方是RouteServiceProvider.php中的mapWebRoutes函数。我需要的是“网络”选项。

protected function mapWebRoutes(Router $router)
{
    $router->group([
        'namespace' => $this->namespace, 'middleware' => 'web',
    ], function ($router) {
        require app_path('Http/routes.php');
    });
}
相关问题