Update : this answer is from 2015! I have not used Laravel for many years, and I am not up to date with the latest best practices. They voted for this answer, so I think it works, but please proceed with caution.
Well, my immediate answer to this is: no. Most likely, you can accomplish your task by changing the data model and working with more complex relationships. It's hard to say without knowing what you want to do, but it seems to me that this is a bad idea in general, especially if you plan to use eloquent models, etc.
However, in some scenario, when you really need to change the data in another database or execute some raw query, you can use the DB::connection() method. Sort of:
$data = DB::connection('another_connection')->select(...);
You can specify this another_connection variable in your database.php file. Like this:
<?php return array( 'default' => 'mysql', 'connections' => array( # Your regular connection 'mysql' => array( 'driver' => 'mysql', 'host' => 'localhost', 'database' => 'database', 'username' => 'user', 'password' => 'password' 'charset' => 'utf8', ), # Your new connection 'another_connection' => array( 'driver' => 'mysql', 'host' => 'another_host', 'database' => 'another_db', 'username' => 'user1', 'password' => 'password1' 'charset' => 'utf8', ), ), );
You can even specify a connection for each eloquent model using protected $connection = 'another_connection'; also you can specify a connection for each model instance created / requested at runtime
$user = new User; $user->setConnection('another_connection'); $user1 = $user->find(1);
But then again, I personally do not think this is a good idea, and it seems to me that everything can get confused and fall apart very quickly, as your application gets complicated.