PHP Method Schema::setConnection, someline-starter Code Examples

This page contains top rated real world PHP examples of method Schema::setConnection from package someline-starter extracted from open source projects. You can rate examples to help us improve the quality of examples

setConnection() public static method

Set the database connection instance.
public static setConnection ( Connection $connection )
$connection Illuminate\Database\Connection
Example #1
Show file File: TestCase.php Project: dadleyy/lvpress
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $config = (require __DIR__ . '/../config.php');
     $capsule = new Manager();
     $capsule->addConnection($config);
     $capsule->bootEloquent();
     Schema::setConnection($capsule->getConnection('default'));
     DB::setConnection($capsule->getConnection('default'));
     // run the migrations
     $migration_repo = new DatabaseMigrationRepository(Model::getConnectionResolver(), 'migrations');
     if (!$migration_repo->repositoryExists()) {
         $migration_repo->createRepository();
     }
     $migrator = new Migrator($migration_repo, Model::getConnectionResolver(), new Filesystem());
     $migrator->rollback();
     $migrator->run(__DIR__ . '/../../src/migrations');
     static::loadFixtures();
 }
Example #2
Show file File: 2015_11_13_104031_econt_regions.php Project: rolice/econt
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::setConnection(DB::connection(Config::get('econt.connection')))->dropIfExists('econt_regions');
 }
Example #3
Show file File: 2016_02_08_081640_create_currencies_table.php Project: Rolice/LaravelCurrency
0
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::setConnection(DB::connection(Config::get('laravel-currency.laravel-currency.connection')))->dropIfExists('currencies');
 }