PHP code example of kalel1500 / laravel-db2-raw

1. Go to this page and download the library: Download kalel1500/laravel-db2-raw 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/ */

    

kalel1500 / laravel-db2-raw example snippets


    
    /*
    |--------------------------------------------------------------------------
    | DB2 connections
    |--------------------------------------------------------------------------
    */

    'default' => env('DB2RAW_CONNECTION', 'main'),

    'connections' => [

        'main' => [
            'host' => env('DB2RAW_HOST'),
            'port' => env('DB2RAW_PORT'),
            'database' => env('DB2RAW_DATABASE'),
            'username' => env('DB2RAW_USERNAME'),
            'password' => env('DB2RAW_PASSWORD'),
        ]

    ]

use Thehouseofel\DB2Raw\Facades\Db2;

Db2::exec($query)

    
    'connections' => [
        //...

        'admin' => [
            'host' => env('DB2RAW_ADMIN_HOST'),
            'port' => env('DB2RAW_ADMIN_PORT'),
            'database' => env('DB2RAW_ADMIN_DATABASE'),
            'username' => env('DB2RAW_ADMIN_USERNAME'),
            'password' => env('DB2RAW_ADMIN_PASSWORD'),
        ]

    ]

use Thehouseofel\DB2Raw\Facades\Db2;

Db2::connection('admin')->exec($query)
bash
php artisan vendor:publish --tag="db2raw"