Trying to use ConnectionFactory class created by singleton in DatabaseServiceProvider
So Tapestry has its default DatabaseServiceProvider.php file containing the code below.
$this->app->singleton('db.factory', function ($app) {
return new ConnectionFactory($app);
});
I want to use the facade created by this db.factory to create a new connection. But when I call
db.factory::make($config,$factory);
Of course it doesn't work, I get the error:
Using undefined constant db - 'db' assumed
How can i do this?
+3
source to share