Lumen出现Call to a member function connection() on null的解决办法

  • 今天在使用Luemn框架时报错
FatalErrorException
 in Model.php line 3339:Call to a member function connection() on null

如下图:

Lumen出现Call to a member function connection() on null的解决办法_第1张图片
7.jpg
  • 解决办法:
    bootstrap\app.php文件中添加如下代码:
    $app->withEloquent();
    问题立即解决

你可能感兴趣的:(Lumen出现Call to a member function connection() on null的解决办法)