Closed JacerOmri closed 6 years ago
@JacerOmri Thanks for reporting this. I will try to take a look at this, but currently don't have a lumen project to test this in. Could you post a repo that has the problem, so I can clone and replicate the issue, and look for a solution? Thanks! :)
@JacerOmri just checking in, would you be able to link to a repository I can download and test this with, where this problem occurs? Thanks!
I will add a repo showing this error soon. Thank you
In Lumen there is a missing alias db.connection
you can fix that by adding this to your register method in your AppServiceProvider:
$this->app->bind('db.connection', function ($app) {
return $app['db']->connection();
});
$this->app->alias('db.connection', \Illuminate\Database\ConnectionInterface::class);
I believe this will be fixed in the next release: #156
Closing this for now due to inactivity. Please re-open with additional information if you are still experiencing this problem.
Describe the bug After a regular install of the package on a Lumen project, and added the caching trait to models, some routes throw an exception
Eloquent Query
Stack Trace
Environment
Additional context This occurs on controllers with few operations (no to few middlewares). I think there is some binding that is assumed to be happening, while it is not. I use redis. I also use Eloquent, Facades and added
cosmicvelocity/lumen-helpers
to definecache()
helper.