Skip to content

Instantly share code, notes, and snippets.

@midned
Created February 7, 2013 00:22
Show Gist options
  • Save midned/4727221 to your computer and use it in GitHub Desktop.
Save midned/4727221 to your computer and use it in GitHub Desktop.
<?php
$resolver = new Illuminate\Database\ConnectionResolver;
$resolver->setDefaultConnection('default');
$factory = new Illuminate\Database\Connectors\ConnectionFactory;
$connection = $factory->make(array(
'host' => 'localhost',
'database' => 'foo',
'username' => 'root',
'password' => 'password',
));
$resolver->addConnection('default', $connection);
Illuminate\Database\Eloquent\Model::setConnectionResolver($resolver);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment