PHPackages                             dbt/odbc-driver - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. dbt/odbc-driver

ActiveLibrary[Database &amp; ORM](/categories/database)

dbt/odbc-driver
===============

ODBC Driver for Laravel 12+

5.0.1(3mo ago)28137.1k↓39.9%13[1 PRs](https://github.com/DeBoerTool/odbc-driver/pulls)MITPHPPHP 8.2.\*|8.3.\*|8.4.\*|8.5.\*CI passing

Since Feb 28Pushed 3mo ago5 watchersCompare

[ Source](https://github.com/DeBoerTool/odbc-driver)[ Packagist](https://packagist.org/packages/dbt/odbc-driver)[ RSS](/packages/dbt-odbc-driver/feed)WikiDiscussions trunk Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (19)Used By (0)

ODBC Driver for Laravel
=======================

[](#odbc-driver-for-laravel)

A simple ODBC driver for Laravel.

### Prerequisites

[](#prerequisites)

Enable the `pdo_odbc` [PHP extension](https://www.php.net/manual/en/ref.pdo-odbc.php).

For other database engines (for instance [MS SQL Server](https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server)), you'll need to install the appropriate PHP extension(s).

### Installation

[](#installation)

For Laravel &lt;=11, use version 4.0. For Laravel 12, use version 5.0.

```
composer require dbt/odbc-driver

```

Laravel will automatically discover the service provider.

### Configuration

[](#configuration)

In your `database.php` config, configure your connection using the `odbc` driver:

```
'my-odbc-connection' => [
    'driver'   => 'odbc',
    'dsn'      => env('ODBC_DSN'),
    'host'     => env('ODBC_HOST'),
    'database' => env('ODBC_DB'),
    'username' => env('ODBC_USERNAME'),
    'password' => env('ODBC_PASSWORD'),
],
```

### Custom Grammar

[](#custom-grammar)

To use SQL Server or other database engines, you can set the grammars in your `database.php` config block for that connection:

```
'my-odbc-connection' => [
    ...,
    'grammar' => [
        'query' => Illuminate\Database\Query\Grammars\SqlServerGrammar::class,
        'schema' => Illuminate\Database\Schema\Grammars\SqlServerGrammar::class,
    ],
],
```

### Usage

[](#usage)

Use the connection like any other, via the query builder or with Eloquent.

For Eloquent, you'll need to specify the model's connection:

```
class Users extends Eloquent {
    /** @var string */
    protected $connection = 'odbc';
}

```

### Connection String

[](#connection-string)

You may need to use some trial and error to figure out what your connection string should look like. Consult your vendor's database documentation.

It could be a connection path:

```
'dsn' => 'odbc:\\\\path\to\my\database',
```

Or a connection name:

```
'dsn' => 'odbc:\\\\my-connection-name',
```

Or something as simple as:

```
'dsn' => 'odbc:dbname',
```

For SQL server, you'll need to specify the DSN, the user, and the password. For example:

```
'dsn' => 'sqlsrv:Driver=ODBC Driver 18 for SQL Server;Server=tcp:localhost,1433;TrustServerCertificate=1;Encrypt=1;'
'username' => 'sa',
'password' => 'my-super-secret-password',
```

### Contributions &amp; License

[](#contributions--license)

Contributions are welcome.

MIT Licensed. Do as you wish.

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance82

Actively maintained with recent releases

Popularity45

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity86

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 94.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~158 days

Recently: every ~172 days

Total

17

Last Release

94d ago

Major Versions

0.4.0 → 1.0.02021-08-23

1.0.0 → 2.0.02022-05-13

2.1.0 → 3.0.02023-05-11

3.0.1 → 4.0.02024-03-27

4.1.0 → 5.0.02025-04-02

PHP version history (9 changes)0.1.0PHP &gt;=7.1.3

0.2.0PHP &gt;=7.2.0

1.0.0PHP ^8.0

3.0.0PHP ^8.1

4.0.0PHP 8.1.\*|8.2.\*

4.0.1PHP 8.1.\*|8.2.\*|8.3.\*

4.1.0PHP 8.1.\*|8.2.\*|8.3.\*|8.4.\*

5.0.0PHP 8.2.\*|8.3.\*|8.4.\*

5.0.1PHP 8.2.\*|8.3.\*|8.4.\*|8.5.\*

### Community

Maintainers

![](https://www.gravatar.com/avatar/ebd3fe214b5768e700ae43c7fdc4b83d249972a6a97a0faef372d0ec19256eca?d=identicon)[danielsdeboer](/maintainers/danielsdeboer)

---

Top Contributors

[![danielsdeboer](https://avatars.githubusercontent.com/u/13170241?v=4)](https://github.com/danielsdeboer "danielsdeboer (66 commits)")[![den1n](https://avatars.githubusercontent.com/u/25498109?v=4)](https://github.com/den1n "den1n (1 commits)")[![justsanjit](https://avatars.githubusercontent.com/u/9400880?v=4)](https://github.com/justsanjit "justsanjit (1 commits)")[![pleungkh](https://avatars.githubusercontent.com/u/60848874?v=4)](https://github.com/pleungkh "pleungkh (1 commits)")[![vincemammoliti](https://avatars.githubusercontent.com/u/26624048?v=4)](https://github.com/vincemammoliti "vincemammoliti (1 commits)")

---

Tags

laraveldatabasedriverodbc

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/dbt-odbc-driver/health.svg)

```
[![Health](https://phpackages.com/badges/dbt-odbc-driver/health.svg)](https://phpackages.com/packages/dbt-odbc-driver)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[toponepercent/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)[dragon-code/laravel-data-dumper

Adding data from certain tables when executing the `php artisan schema:dump` console command

3418.6k](/packages/dragon-code-laravel-data-dumper)[aimeos/laravel-nestedset

Nested Set Model for Laravel

292.0k2](/packages/aimeos-laravel-nestedset)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
