When I have set up a ".env" for using two DBs, also made code as below for use it.
but where() method was incorrect to use it.
Could you tell me more detailed usages to use where() method with explanation or tell some link to study?
Thanks in advenced.
$master = DB::connection('master_db')->table('customer_master')
->where(['name', '=', 'string'],
['tel', '=', 'integer'],
['address','=', 'string']);
$slave = DB::connection('slave_db')->table('customer_slave')
->where(['histories', '=', 'string'])
->union($master)
->get();
Write the query like this:
Here the array syntax has been tweaked for
$master
andwhere()
tweaked for$slave
. The=
comparison is the default so no need to specify here.