PHPackages                             djolecodes/db2-laravel-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. djolecodes/db2-laravel-driver

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

djolecodes/db2-laravel-driver
=============================

DB2 for IBM iSeries drop-in Laravel driver

1.4.0(8mo ago)0458↓46.4%1MITPHPPHP ^8.1

Since Jul 12Pushed 8mo agoCompare

[ Source](https://github.com/djordje47/db2-laravel-driver)[ Packagist](https://packagist.org/packages/djolecodes/db2-laravel-driver)[ Docs](https://github.com/djordje47/db2-laravel-driver)[ RSS](/packages/djolecodes-db2-laravel-driver/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (9)Versions (6)Used By (0)

DB2 for IBM Laravel Driver
==========================

[](#db2-for-ibm-laravel-driver)

This package allows you to use Laravel's query builder and eloquent with DB2 for IBM iSeries by extending the Illuminate Database component of the Laravel framework. Originally forked from [BWICompanies](https://github.com/BWICompanies/db2-driver).

Modification done by me is that we can't use the IBM DB2 driver but only odbc, by specifying the `use_ibm_driver=true` connection string will be created for the IBM DB2 driver instead for the ODBC like previous authors intended. I've done this only because I cant use the [cooperl22/laravel-db2](https://github.com/cooperl22/laravel-db2). And I want to use the regular IBM DB2 driver with laravel 10. Since this package works with Laravel 10 I forked the repo and made small modification in the connection string.

Requirements
------------

[](#requirements)

- IBM dsdriver installed {IBM DB2 ODBC DRIVER}
- IBM PDO INSTALLED

Installation
------------

[](#installation)

Install the package via composer:

```
composer require djolecodes/db2-laravel-driver
```

Add a new connection in `database.php`:

> Note: You can specify the connection name, but the driver must be 'db2'

```
'myDB2Connection' => [
    'driver'        => 'db2',
    'driverName'    => '{IBM DB2 ODBC DRIVER}',
    'host'          => env('DB_HOST'),
    'username'      => env('DB_USERNAME'),
    'password'      => env('DB_PASSWORD'),
    'database'      => env('DB_DATABASE'),
    'prefix'        => '',
    'use_ibm_driver'=> true,
    'schema'        => env('DB_SCHEMA'),
    'port'          => env('DB_PORT', 50000),
    'date_format'   => 'Y-m-d H:i:s', // or 'Y-m-d H:i:s.u' / 'Y-m-d-H.i.s.u'
    'offset_compatibility_mode' => true,
    'odbc_keywords' => [
        'SIGNON'                => 3,
        'SSL'                   => 0,
        'CommitMode'            => 0,
        'ConnectionType'        => 0,
        'DefaultLibraries'      => '',
        'Naming'                => 1,
        'UNICODESQL'            => 0,
        'DateFormat'            => 5,
        'DateSeperator'         => 0,
        'Decimal'               => 0,
        'TimeFormat'            => 0,
        'TimeSeparator'         => 0,
        'TimestampFormat'       => 0,
        'ConvertDateTimeToChar' => 0,
        'BLOCKFETCH'            => 1,
        'BlockSizeKB'           => 32,
        'AllowDataCompression'  => 1,
        'CONCURRENCY'           => 0,
        'LAZYCLOSE'             => 0,
        'MaxFieldLength'        => 15360,
        'PREFETCH'              => 0,
        'QUERYTIMEOUT'          => 1,
        'DefaultPkgLibrary'     => 'QGPL',
        'DefaultPackage'        => 'A /DEFAULT(IBM),2,0,1,0',
        'ExtendedDynamic'       => 1,
        'QAQQINILibrary'        => '',
        'SQDIAGCODE'            => '',
        'LANGUAGEID'            => 'ENU',
        'SORTTABLE'             => '',
        'SortSequence'          => 0,
        'SORTWEIGHT'            => 0,
        'AllowUnsupportedChar'  => 0,
        'CCSID'                 => 1208,
        'GRAPHIC'               => 0,
        'ForceTranslation'      => 0,
        'ALLOWPROCCALLS'        => 0,
        'DB2SQLSTATES'          => 0,
        'DEBUG'                 => 0,
        'TRUEAUTOCOMMIT'        => 0,
        'CATALOGOPTIONS'        => 3,
        'LibraryView'           => 0,
        'ODBCRemarks'           => 0,
        'SEARCHPATTERN'         => 1,
        'TranslationDLL'        => '',
        'TranslationOption'     => 0,
        'MAXTRACESIZE'          => 0,
        'MultipleTraceFiles'    => 1,
        'TRACE'                 => 0,
        'TRACEFILENAME'         => '',
        'ExtendedColInfo'       => 0,
    ],
    'options' => [
        PDO::ATTR_CASE             => PDO::CASE_LOWER,
        PDO::ATTR_EMULATE_PREPARES => false,
        PDO::ATTR_PERSISTENT       => false,
    ]
],
```

> Note: Be sure to define the appropriate keys in `.env`.

Other Resources
---------------

[](#other-resources)

- [DB2 Connection String Keywords](https://www.ibm.com/docs/fr/i/7.3?topic=details-connection-string-keywords)
- [PDO Attributes](https://www.w3resource.com/php/pdo/php-pdo.php)
- [ACS / IBM i Access Driver Release Notes](https://www.ibm.com/support/pages/ibm-i-access-acs-updates-pase)
- [Seiden Group](https://www.seidengroup.com/blog/)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance61

Regular maintenance activity

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~107 days

Total

5

Last Release

244d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/28a245d7729e994f5aea166dad9562503f7e529d20f0864d7f1fe61f4fffe2f7?d=identicon)[djole](/maintainers/djole)

---

Top Contributors

[![bennettblack](https://avatars.githubusercontent.com/u/51721783?v=4)](https://github.com/bennettblack "bennettblack (10 commits)")[![djordje47](https://avatars.githubusercontent.com/u/16069373?v=4)](https://github.com/djordje47 "djordje47 (6 commits)")[![sluggern67](https://avatars.githubusercontent.com/u/57130207?v=4)](https://github.com/sluggern67 "sluggern67 (2 commits)")[![alanseiden](https://avatars.githubusercontent.com/u/5905791?v=4)](https://github.com/alanseiden "alanseiden (1 commits)")[![anchan42](https://avatars.githubusercontent.com/u/19514416?v=4)](https://github.com/anchan42 "anchan42 (1 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (1 commits)")

---

Tags

laravelBWICompaniesdb2-driverdjolecodes

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/djolecodes-db2-laravel-driver/health.svg)

```
[![Health](https://phpackages.com/badges/djolecodes-db2-laravel-driver/health.svg)](https://phpackages.com/packages/djolecodes-db2-laravel-driver)
```

###  Alternatives

[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[spatie/laravel-health

Monitor the health of a Laravel application

86910.0M83](/packages/spatie-laravel-health)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[outerweb/settings

Application wide settings stored in your database

4899.2k5](/packages/outerweb-settings)

PHPackages © 2026

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