While running integration and feature tests using SQLite driver and the query is not completed initialized in a multitenant scenario and for example the value of $this->query->toSql() will be select * or 1, this will fallback to the default connection instead of using the proper model connection.
Additional context
Since the query is not complete or valid in the target table, eloquent falls back to the default connection, which on the model constructor the defined connection is different, using a multitenant with multiple connections.
Describe the bug
While running integration and feature tests using SQLite driver and the query is not completed initialized in a multitenant scenario and for example the value of
$this->query->toSql()
will beselect *
or1
, this will fallback to the default connection instead of using the proper model connection.Eloquent Query
Environment
Additional context Since the query is not complete or valid in the target table, eloquent falls back to the default connection, which on the model constructor the defined connection is different, using a multitenant with multiple connections.