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

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

majikang/laravel-db2
====================

laravel-db2 is a simple DB2 service provider for Laravel. Customized by Seuic

1.0(9y ago)386MITPHPPHP &gt;=5.4.0

Since Oct 19Pushed 9y ago1 watchersCompare

[ Source](https://github.com/mjk0621/laravel-db2)[ Packagist](https://packagist.org/packages/majikang/laravel-db2)[ RSS](/packages/majikang-laravel-db2/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (2)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)
- [Registering the Package](#registering-the-package)
- [Configuration](#configuration)
- [Usage](#usage)

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

[](#installation)

Add laravel-db2 to your composer.json file:

```
"require": {
    "majikang/laravel-db2": "~1.0"
}

```

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

```
$ composer update

```

### Registering the Package

[](#registering-the-package)

Add the laravel-db2 Service Provider to your config in `app/config/app.php`:

```
'providers' => [
    'Cooperl\Database\DB2\DB2ServiceProvider'
],
```

### 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 be generated through command line by artisan (option 2).

#### 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'               => 'odbc' / 'ibm' / 'odbczos',
        'driverName'           => '{IBM i Access ODBC Driver}' / '{iSeries Access ODBC Driver}',
         // General settings
        'host'                 => 'server',
        'username'             => '',
        'password'             => '',
        //Server settings
        'database'             => 'WRKRDBDIRE entry',
        'prefix'               => '',
        'schema'               => 'default schema',
        'port'                 => 50000,
        'signon'               => 3,
        'ssl'                  => 0,
        'commitMode'           => 2,
        'connectionType'       => 0,
        'defaultLibraries'     => '',
        'naming'               => 0,
        'unicodeSql'           => 0,
        // Format settings
        'dateFormat'           => 5,
        'dateSeperator'        => 0,
        'decimal'              => 0,
        'timeFormat'           => 0,
        'timeSeparator'        => 0,
        // Performances settings
        'blockFetch'           => 1,
        'blockSizeKB'          => 32,
        'allowDataCompression' => 1,
        'concurrency'          => 0,
        'lazyClose'            => 0,
        'maxFieldLength'       => 15360,
        'prefetch'             => 0,
        'queryTimeout'         => 1,
        // Modules settings
        'defaultPkgLibrary'    => 'QGPL',
        'defaultPackage'       => 'A/DEFAULT(IBM),2,0,1,0',
        'extendedDynamic'      => 1,
        // Diagnostic settings
        'QAQQINILibrary'       => '',
        'sqDiagCode'           => '',
        // Sort settings
        'languageId'           => 'ENU',
        'sortTable'            => '',
        'sortSequence'         => 0,
        'sortWeight'           => 0,
        'jobSort'              => 0,
        // Conversion settings
        'allowUnsupportedChar' => 0,
        'ccsid'                => 1208,
        'graphic'              => 0,
        'forceTranslation'     => 0,
        // Other settings
        '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
        ]
    ],
```

driver setting is either 'odbc' for ODBC connection or 'ibm' for pdo\_ibm connection Then if driver is 'odbc', database must be set to ODBC connection name. if driver is '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 config:publish cooperl/laravel-db2

```

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

Usage
-----

[](#usage)

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

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

3541d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/142912?v=4)[matt](/maintainers/mjk)[@mjk](https://github.com/mjk)

---

Top Contributors

[![conrad621](https://avatars.githubusercontent.com/u/7512052?v=4)](https://github.com/conrad621 "conrad621 (3 commits)")

---

Tags

laraveldatabasepdodb2odbc

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[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.

58123.4k1](/packages/cooperl-laravel-db2)[ntanduy/cloudflare-d1-database

Cloudflare D1 database driver for Laravel — full Eloquent &amp; Query Builder support.

266.8k](/packages/ntanduy-cloudflare-d1-database)[itpathsolutions/dbstan

Database Standardization and Analysis Tool for Laravel

442.1k](/packages/itpathsolutions-dbstan)

PHPackages © 2026

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