PHP code example of kkszymanowski / laravel-6-firebird

1. Go to this page and download the library: Download kkszymanowski/laravel-6-firebird 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/ */

    

kkszymanowski / laravel-6-firebird example snippets


'connections' => [
    'myFirebirdConnection' => [
        'driver'   => 'firebird',
        'host'     => env('DB_FIREBIRD_HOST', 'localhost'),
        'port'     => env('DB_FIREBIRD_PORT', '3050'),
        'database' => env('DB_FIREBIRD_DATABASE', '/path_to/database.fdb'),
        'username' => env('DB_FIREBIRD_USERNAME', 'SYSDBA'),
        'password' => env('DB_FIREBIRD_PASSWORD', 'masterkey'),
        'charset'  => env('DB_FIREBIRD_CHARSET', 'UTF8'),
    ],

    // ...
],

/**
 * The connection name for the model.
 *
 * @var string
 */
protected $connection = 'myFirebirdConnection';

$user = User::where('id', 1)->get();

$users = User::all();

$sql = 'SELECT * FROM USERS WHERE id = :id';
$bindings = ['id' => 1];
$user = DB::connection('myFirebirdConnection')->select($sql, $bindings);

$users = DB::connection('myFirebirdConnection')->table('USERS')->select('*')->get();