bencarter78 / odbc

MIT License
24 stars 17 forks source link

"Unsupported driver [odbc]" #20

Open jeremiahsherrill opened 5 years ago

jeremiahsherrill commented 5 years ago

PHP 7.2 Laravel 5.7 odbc is installed as a php extension

/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php

 * @throws \InvalidArgumentException
     */
    protected function createConnection($driver, $connection, $database, $prefix = '', array $config = [])
    {
        if ($resolver = Connection::getResolver($driver)) {
            return $resolver($connection, $database, $prefix, $config);
        }

        switch ($driver) {
            case 'mysql':
                return new MySqlConnection($connection, $database, $prefix, $config);
            case 'pgsql':
                return new PostgresConnection($connection, $database, $prefix, $config);
            case 'sqlite':
                return new SQLiteConnection($connection, $database, $prefix, $config);
            case 'sqlsrv':
                return new SqlServerConnection($connection, $database, $prefix, $config);
        }

        throw new InvalidArgumentException("Unsupported driver [{$driver}]");
    }
}

Arguments
"Unsupported driver [odbc]"
danielsdeboer commented 5 years ago

Check to make sure you have the pdo_odbc extension enabled, not just odbc.