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

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

jorgcastellano/laravel-db2
==========================

Fork from cooperl/laravel-db2, laravel-db2 is a simple DB2 service provider for Laravel. It provides DB2 Connection by extending the Illuminate Database component of the laravel framework.

7.0.1(5y ago)248MITPHPPHP ^7.2.5

Since Apr 22Pushed 5y agoCompare

[ Source](https://github.com/jorgcastellano/laravel-db2)[ Packagist](https://packagist.org/packages/jorgcastellano/laravel-db2)[ RSS](/packages/jorgcastellano-laravel-db2/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (1)Versions (48)Used By (0)

laravel-db2
===========

[](#laravel-db2)

[![Latest Stable Version](https://camo.githubusercontent.com/ddfaf60f7c28723babec9ad03ee0c5ced4eba565838776403d599ee03e140ffd/68747470733a2f2f706f7365722e707567782e6f72672f636f6f7065726c2f6c61726176656c2d6462322f762f737461626c65)](https://packagist.org/packages/cooperl/laravel-db2)[![Total Downloads](https://camo.githubusercontent.com/317c4a5bf9e6e081e51a17bc43859ade7748f9b7046ac52c98611aa0169f64ca/68747470733a2f2f706f7365722e707567782e6f72672f636f6f7065726c2f6c61726176656c2d6462322f646f776e6c6f616473)](https://packagist.org/packages/cooperl/laravel-db2)[![Latest Unstable Version](https://camo.githubusercontent.com/58a5583cde6cb7ba2974638ebe3ccf6c915b027b8c0f236993c63e9ff31bf459/68747470733a2f2f706f7365722e707567782e6f72672f636f6f7065726c2f6c61726176656c2d6462322f762f756e737461626c65)](https://packagist.org/packages/cooperl/laravel-db2)[![License](https://camo.githubusercontent.com/2778c08056b18b12f40194b484120e59f2f86424f94c4f87e9645f0934a76301/68747470733a2f2f706f7365722e707567782e6f72672f636f6f7065726c2f6c61726176656c2d6462322f6c6963656e7365)](https://packagist.org/packages/cooperl/laravel-db2)

laravel-db2 is a simple DB2 service provider for Laravel. It provides DB2 Connection by extending the Illuminate Database component of the laravel framework.

---

- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)

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

[](#installation)

Add laravel-db2 to your composer.json file:

```
"require": {
    "cooperl/laravel-db2": "^7.0"
}

```

Use [composer](https://getcomposer.org) to install this package.

```
$ composer update

```

### Configuration

[](#configuration)

There are two ways to configure laravel-db2. You can choose the most convenient way for you. You can put your DB2 credentials into `app/config/database.php` (option 1) file or use package config file which you can generate through command line by artisan (option 2).

Please check appropriate specific DSN parameters for your connection. For instance here are the ODBC keywords for IBMi [https://www.ibm.com/support/knowledgecenter/fr/ssw\_ibm\_i\_74/rzaik/connectkeywords.htm](https://www.ibm.com/support/knowledgecenter/fr/ssw_ibm_i_74/rzaik/connectkeywords.htm)

If you encounter issues with char fields containing characters outside the invariant character set (for example: "ü") please see : For PHP applications using the UTF8 locale the workaround to prevent the extra garbage data is to set the following connection string keyword: DEBUG = 65536

#### Option 1: Configure DB2 using `app/config/database.php` file

[](#option-1-configure-db2-using-appconfigdatabasephp-file)

Simply add this code at the end of your `app/config/database.php` file:

```
    /*
    |--------------------------------------------------------------------------
    | DB2 Databases
    |--------------------------------------------------------------------------
    */

    'ibmi' => [
        'driver' => 'db2_ibmi_odbc',
        // or 'db2_ibmi_ibm' / 'db2_zos_odbc' / 'db2_expressc_odbc
        'driverName' => '{IBM i Access ODBC Driver}',
        // or '{iSeries Access ODBC Driver}' / '{IBM i Access ODBC Driver 64-bit}'
        'host' => 'server',
        'username' => '',
        'password' => '',
        'database' => 'WRKRDBDIRE entry',
        'prefix' => '',
        'schema' => 'default schema',
        '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'...
        'odbc_keywords' => [
            'SIGNON' => 3,
            'SSL' => 0,
            'CommitMode' => 2,
            'ConnectionType' => 0,
            'DefaultLibraries' => '',
            'Naming' => 0,
            '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' => 0,
            'QAQQINILibrary' => '',
            'SQDIAGCODE' => '',
            'LANGUAGEID' => 'ENU',
            'SORTTABLE' => '',
            'SortSequence' => 0,
            'SORTWEIGHT' => 0,
            'AllowUnsupportedChar' => 0,
            'CCSID' => 819,
            '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_PERSISTENT => false
        ]
        + (defined('PDO::I5_ATTR_DBC_SYS_NAMING') ? [PDO::I5_ATTI5_ATTR_DBC_SYS_NAMINGR_COMMIT => false] : [])
        + (defined('PDO::I5_ATTR_COMMIT') ? [PDO::I5_ATTR_COMMIT => PDO::I5_TXN_NO_COMMIT] : [])
        + (defined('PDO::I5_ATTR_JOB_SORT') ? [PDO::I5_ATTR_JOB_SORT => false] : [])
        + (defined('PDO::I5_ATTR_DBC_LIBL') ? [PDO::I5_ATTR_DBC_LIBL => ''] : [])
        + (defined('PDO::I5_ATTR_DBC_CURLIB') ? [PDO::I5_ATTR_DBC_CURLIB => ''] : [])
    ],
```

driver setting can be:

- 'db2\_ibmi\_odbc' for IBMi ODBC connection
- 'db2\_ibmi\_ibm' for IBMi PDO\_IBM connection
- 'db2\_zos\_odbc' for zOS ODBC connection
- 'db2\_expressc\_odbc for Express-C ODBC connection

Then if driver is 'db2\_\*\_odbc', database must be set to ODBC connection name. if driver is 'db2\_ibmi\_ibm', database must be set to IBMi database name (WRKRDBDIRE).

#### Option 2: Configure DB2 using package config file

[](#option-2-configure-db2-using-package-config-file)

Run on the command line from the root of your project:

```
$ php artisan vendor:publish

```

Set your laravel-db2 credentials in `app/config/db2.php`the same way as above

Usage
-----

[](#usage)

Consult the [Laravel framework documentation](https://laravel.com/docs).

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 80% 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 ~42 days

Recently: every ~70 days

Total

46

Last Release

2143d ago

Major Versions

1.0 → 2.02015-05-06

2.5.2 → 5.32017-04-14

5.7.x-dev → 6.0.02019-09-25

5.5.4 → 7.02020-04-24

PHP version history (6 changes)1.0PHP &gt;=5.4.0

5.3PHP &gt;=5.6.4

5.5.0PHP &gt;=7.0.0

5.6.0PHP &gt;=7.1.3

6.0.0PHP ^7.2

7.0.1PHP ^7.2.5

### Community

Maintainers

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

---

Top Contributors

[![cooperl22](https://avatars.githubusercontent.com/u/12048268?v=4)](https://github.com/cooperl22 "cooperl22 (28 commits)")[![jorgcastellano](https://avatars.githubusercontent.com/u/12506964?v=4)](https://github.com/jorgcastellano "jorgcastellano (2 commits)")[![lucasmezencio](https://avatars.githubusercontent.com/u/472412?v=4)](https://github.com/lucasmezencio "lucasmezencio (2 commits)")[![bironeaj](https://avatars.githubusercontent.com/u/16939160?v=4)](https://github.com/bironeaj "bironeaj (1 commits)")[![mfrancisc](https://avatars.githubusercontent.com/u/10716933?v=4)](https://github.com/mfrancisc "mfrancisc (1 commits)")[![sarahkemp](https://avatars.githubusercontent.com/u/2836313?v=4)](https://github.com/sarahkemp "sarahkemp (1 commits)")

---

Tags

laraveldatabasepdodb2odbc

### Embed Badge

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

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

###  Alternatives

[cooperl/laravel-db2

laravel-db2 is a simple DB2 service provider for Laravel. It provides DB2 Connection by extending the Illuminate Database component of the laravel framework.

58120.3k1](/packages/cooperl-laravel-db2)[cooperl/laravel-ibmi

laravel-ibmi is a simple DB2 &amp; Toolkit for IBMi service provider for Laravel. It provides DB2 Connection by extending the Illuminate Database component of the laravel framework. Plus it also provides Toolkit for IBMi so that you can access IBMi resources with same credentials.

1013.9k](/packages/cooperl-laravel-ibmi)

PHPackages © 2026

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