PHPackages                             cooperl/laravel-ibmi - 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. cooperl/laravel-ibmi

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

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.

9.0.3(3y ago)1013.9k↑62.5%14[3 PRs](https://github.com/cooperl22/laravel-ibmi/pulls)MITPHPPHP ^8.0|^8.1|^8.2

Since Apr 22Pushed 2y ago3 watchersCompare

[ Source](https://github.com/cooperl22/laravel-ibmi)[ Packagist](https://packagist.org/packages/cooperl/laravel-ibmi)[ RSS](/packages/cooperl-laravel-ibmi/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (38)Used By (0)

laravel-ibmi
============

[](#laravel-ibmi)

[![Latest Stable Version](https://camo.githubusercontent.com/d321448fd326e8e2fa88beb0a521e3e19299fabecca65615de2b81dd47a5a821/68747470733a2f2f706f7365722e707567782e6f72672f636f6f7065726c2f6c61726176656c2d69626d692f762f737461626c65)](https://packagist.org/packages/cooperl/laravel-ibmi)[![Total Downloads](https://camo.githubusercontent.com/284fd9eb63c97a8a66ff22387953193cb29ef9a54ffc19cd1d5b2d668d605ef4/68747470733a2f2f706f7365722e707567782e6f72672f636f6f7065726c2f6c61726176656c2d69626d692f646f776e6c6f616473)](https://packagist.org/packages/cooperl/laravel-ibmi)[![Latest Unstable Version](https://camo.githubusercontent.com/7a87367d3cfa053cf7c5b0c23460ab94cea53e2740cdb64592f89b47dceda844/68747470733a2f2f706f7365722e707567782e6f72672f636f6f7065726c2f6c61726176656c2d69626d692f762f756e737461626c65)](https://packagist.org/packages/cooperl/laravel-ibmi)[![License](https://camo.githubusercontent.com/ac1f3b645bc0a02732716b8d8aa39af43ce841325c2dc838a701c66cfd7d5c1a/68747470733a2f2f706f7365722e707567782e6f72672f636f6f7065726c2f6c61726176656c2d69626d692f6c6963656e7365)](https://packagist.org/packages/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.

---

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

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

[](#installation)

Add laravel-ibmi to your composer.json file:

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

```

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

```
$ composer update

```

### Configuration

[](#configuration)

There are two ways to configure laravel-ibmi. 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' => '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 => ''] : []),
        'toolkit' => [
            'sbmjobParams' => 'ZENDPHP7/ZSVR_JOBD/XTOOLKIT',
            'XMLServiceLib' => 'ZENDPHP7',
            'debug' => false,
            'debugLogFile' => storage_path('logs / toolkit_gigc . log'),
            'InternalKey' => ' / tmp / ' . 'Toolkit_' . env('APP_ENV') . '_' . random_int(1, 10),
            'stateless' => false,
            'plugSize' => '512K',
            'encoding' => "UTF-8",
            'ccsidBefore' => "819/1147",
            'ccsidAfter' => "1147/1208",
            'useHex' => true
        ],
    ],
```

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)

#### Database usage

[](#database-usage)

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

#### Toolkit for IBMi usage :

[](#toolkit-for-ibmi-usage-)

This package ships with a facade called `TS` for ToolkitService which is the name of the main class.

here is an example of how to use this facade:

```
    $param[] = TS::AddParameterChar('both', 10, 'InventoryCode', 'code', $code);
    $param[] = TS::AddParameterChar('both', 10, 'Description', 'desc', $desc);
    $result = TS::PgmCall("COMMONPGM", "ZENDSVR", $param, null, null);
    if($result)
    {
        var_dump($result['io_param']);
    }
    else
    {
        echo "Execution failed.";
    }
```

If you want to choose another connection than the default one just do this:

```
    $param[] = TS::connection('other_connection')->AddParameterChar('both', 10, 'InventoryCode', 'code', $code);
    $param[] = TS::connection('other_connection')->AddParameterChar('both', 10, 'Description', 'desc', $desc);
    $result = TS::connection('other_connection')->PgmCall("COMMONPGM", "ZENDSVR", $param, null, null);
    if($result)
    {
        var_dump($result['io_param']);
    }
    else
    {
        echo "Execution failed.";
    }
```

for more details please consult [PHP XMLSERVICE Toolkit documentation](https://docs.roguewave.com/en/zend/current/content/php_toolkit_xml_service_functions.htm).

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 68.2% 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 ~79 days

Total

37

Last Release

1196d ago

Major Versions

5.8.0 → 6.0.02019-09-25

6.0.1 → 7.0.02020-05-04

7.1.0 → 8.0.02022-03-09

6.0.2 → 7.1.12022-03-09

7.1.1 → 9.0.02022-03-10

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

5.5PHP &gt;=7.0.0

5.6.x-devPHP &gt;=7.1.3

6.0.0PHP ^7.2

7.0.0PHP ^7.2.5

8.0.0PHP ^8.0

6.0.2PHP ^7.2|^8.0

7.1.1PHP ^7.2.5|^8.0

9.0.1PHP ^8.0|^8.1|^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c51ddf86c2ad1a98b84063fc095921af6a9f9ad4d0ffa4e09715ef69a7d74b5?d=identicon)[cooperl](/maintainers/cooperl)

---

Top Contributors

[![cooperl22](https://avatars.githubusercontent.com/u/12048268?v=4)](https://github.com/cooperl22 "cooperl22 (15 commits)")[![boivinj](https://avatars.githubusercontent.com/u/90038153?v=4)](https://github.com/boivinj "boivinj (4 commits)")[![Blurazzle](https://avatars.githubusercontent.com/u/54948500?v=4)](https://github.com/Blurazzle "Blurazzle (3 commits)")

---

Tags

laraveldatabasepdodb2odbcIBMias400ToolkitAPI

### Embed Badge

![Health badge](/badges/cooperl-laravel-ibmi/health.svg)

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

###  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)

PHPackages © 2026

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