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

后端 未结 5 1123
长发绾君心
长发绾君心 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条回答
  •  猫巷女王i
    2021-02-13 12:27

    What i did was simple, i just forgot to uncomment $app->withFacades(); $app->withEloquent(); in my bootstrap/app.php.

    Now works fine

提交回复
热议问题