Laravel/Eloquent: Fatal error: Call to a member function connection() on a non-object

后端 未结 5 1110
长发绾君心
长发绾君心 2021-02-13 12:06

I\'m building a package in Laravel 4 but am getting a non-object error when attempting to access the db from which seems to be a properly instantiated object. Here\'s the setup:

5条回答
  •  后悔当初
    2021-02-13 12:22

    In case you're working with Lumen, you may occur identical problem. In this case just uncomment:

    // $app->withFacades();
    
    // $app->withEloquent();
    

    in bootstrap\app.php

提交回复
热议问题