laravel-db2-bridge
Use Laravel's database and Eloquent tools on DB2 with no fuss, (*1)
:WARNING: Heads Up :WARNING:
This is a very very preliminary release of this package and should be used at your own risk. The code here
does everything I need it to, but does not yet fully implement Laravel's database or Eloquent components.
Suggestions are gratefully accepted. Pull Requests are even more gratefully accepted., (*2)
License
LaravelDB2Bridge is open-sourced software licensed under the MIT license, the same license Laravel uses., (*3)
Requirements
LaravelDB2Bridge wraps PHP's native db2_* database functions to be called from Laravel. You must have
the ibm_db2
extension installed to use this package., (*4)
Installation
Via Composer, (*5)
$ composer require jtgrimes\laravel-db2-bridge
Once Composer has installed or updated your packages, you need to register
LaravelDB2Bridge with Laravel itself. Open up /config/app.php
and
find the providers key towards the bottom and add:, (*6)
'JTGrimes\LaravelDB2\DB2ServiceProvider'
Configuration
When you use LaravelDB2Bridge, DB2 becomes just another database driver in Laravel. To configure
your database, open /config/database.php
and add the following to the connections
array:, (*7)
'db2' => [
'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),
'dbname' => '*LOCAL',
'options' => [
'i5_libl' => 'QTEMP OTHERLIB ANOTHEROTHERLIB',
'i5_naming' => 'DB2_I5_NAMING_OFF',
...
],
],
Obviously, you can tweak those settings to suit your needs. All of the
connection options are available and
can be set in the options
array., (*8)
Usage
Use Laravel's database and Eloquent
packages as you usually would., (*9)
Credits
Taylor Otwell wrote Laravel which is awesome, but he shares no blame for this package.
Alan Seiden deserves a little blame for encouraging me to release this package. If you're
running PHP on the IBM iSeries, he's the guy to hit up for help., (*10)