The current implementation determines the database driver from the default database configuration file. This can cause issues when a model uses a database that is different from the default. This pull request fixes this by determining the driver based on the model configuration, using methods built into the framework.
I believe this to be a fix that brings it into alignment with expectations, but there's a slim chance it could cause breaking changes if people were relying on the existing behavior.
I was unable to get the tests running on a fresh Laravel project and therefore did not check existing tests or add an additional test for this use case. In practice, it was working for me though.
The current implementation determines the database driver from the default database configuration file. This can cause issues when a model uses a database that is different from the default. This pull request fixes this by determining the driver based on the model configuration, using methods built into the framework.
I believe this to be a fix that brings it into alignment with expectations, but there's a slim chance it could cause breaking changes if people were relying on the existing behavior.
I was unable to get the tests running on a fresh Laravel project and therefore did not check existing tests or add an additional test for this use case. In practice, it was working for me though.