Is it possible to instantiate a db adapter inside a model using laminas\db. I’m using the pdo driver with mysql. I have tried using laminas\db\adapter supplying dns username and password but not connecting. I must be missing something…
Sure, it can be done, laminas-db does not restrict you. But this means that your model is directly dependent on the adapter and the implementation of a second model will be difficult and leads to other problems.
So this is not a good idea.
What error message did you receive?
Please compare your setting with the configuration options of a adapter: