I'm working on a project with Laravel 4 where I use a postgres-db. The public-schema is the main schema for the admin. All the other custom schemas are for clients. All schemas are having the same tables setup.
But for some clients, the must retrieve data multiple schemas. Is this possible with L4? Or do I have to write custom queries?
These are my settings for the db-connection
'pgsql' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'postgres',
'username' => 'postgres',
'password' => 'root',
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public, client1, client2',
),
But when I'm preforming the query:
$users = Users::all()
**OR**
$users = DB::select(DB::raw('SELECT * FROM client1.users, client2.users'));
I'm only retrieving the users from public. Did I miss something or isn't this possible with Laravel?
Thanks in advance