You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please take a look at this. I'm trying to connect to a 2nd database but Eloquent keeps the settings of the "first" connection. Please see the following snippet of one of my classes:
So the second Model should use the DB settings from the config, but uses the first initiated values. In this example the (connectExternal) Migration. So instead of above it should query on:
'845461375_wpdb.wp_dealers'
As @szepeviktor mentioned: it shouldn't be a clone (of the first initiation of the class) but a reference to the super global. OR any other solution.
Can you see to it that we can connect to multiple databases with your class?
AFAIK when you put
$wpdb
into$this->db
it gets cloned instead of a reference.What do you think about https://github.com/szepeviktor/debian-server-tools/blob/master/webserver/wordpress/_core-wpdb.php?
The text was updated successfully, but these errors were encountered: