Skip to content

Instantly share code, notes, and snippets.

@web-hat
Created March 30, 2017 05:08
Show Gist options
  • Save web-hat/6e16076e1afb0cbfb93aece70d71c66d to your computer and use it in GitHub Desktop.
Save web-hat/6e16076e1afb0cbfb93aece70d71c66d to your computer and use it in GitHub Desktop.
<?php
//Defining a connection in Query Builder
$data = DB::connection('mysql_second')
->table('table_name')
->select('col_1')
->get();
//Defining a connection within the Schema Builder.
Schema::connection('mysql_second')->create('table_name', function($table) {
$table->increments('id');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment