Skip to content

Instantly share code, notes, and snippets.

@adamtester
Created June 1, 2018 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamtester/2cd93bf2c1e0aac74074923ec9943a84 to your computer and use it in GitHub Desktop.
Save adamtester/2cd93bf2c1e0aac74074923ec9943a84 to your computer and use it in GitHub Desktop.
Force SQL Server connection using odbc instead of dblib in laravel
/**
* Create a DSN string from a configuration.
*
* @param array $config
* @return string
*/
protected function getDsn(array $config)
{
// First we will create the basic DSN setup as well as the port if it is in
// in the configuration options. This will give us the basic DSN we will
// need to establish the PDO connections and return them back for use.
return $this->getSqlSrvDsn($config);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment