Schema::getConnection PHP Method

getConnection() public static method

Get the database connection instance.
public static getConnection ( ) : Connection
return Illuminate\Database\Connection
        public static function getConnection()
        {
            //Method inherited from \Illuminate\Database\Schema\Builder
            return \Illuminate\Database\Schema\MySqlBuilder::getConnection();
        }

Usage Example

Example #1
0
 /**
  * Resets the database and install the migration table.
  *
  * @return void
  */
 protected function migrate()
 {
     $tableNames = Schema::getConnection()->getDoctrineSchemaManager()->listTableNames();
     foreach ($tableNames as $table) {
         Schema::drop($table);
     }
     $this->app['Illuminate\\Contracts\\Console\\Kernel']->call('migrate:install', ['--env' => 'testing']);
 }
All Usage Examples Of Schema::getConnection