1. Go to this page and download the library: Download idl-bnl-dev/db2-driver library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Illuminate\Database\Eloquent\Model;
class Order extends Model
{
protected $connection = 'myDB2Connection';
protected $table = 'ORDERS';
protected $primaryKey = 'ORDER_ID';
public $timestamps = false;
}
$open = Order::where('STATUS', 'OPEN')->paginate(25);
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
Schema::connection('myDB2Connection')->create('CUSTOMERS', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->timestamps();
$table->forSystemName('CUSTOMR'); // IBM i system name (max 10 chars)
$table->label('Customers'); // table label
});