PHP code example of t1nkl / postgres-pgbouncer-extension

1. Go to this page and download the library: Download t1nkl/postgres-pgbouncer-extension 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/ */

    

t1nkl / postgres-pgbouncer-extension example snippets


'connections' => [
    'pgsql' => [
        'driver' => 'pgsql',
        'host' => env('DB_HOST', '127.0.0.1'),
        'port' => env('DB_PORT', '5432'),
        'database' => env('DB_DATABASE', 'forge'),
        'username' => env('DB_USERNAME', 'forge'),
        'password' => env('DB_PASSWORD', ''),
        'charset' => 'utf8',
        'prefix' => '',
        'search_path' => 'public',
        'sslmode' => 'prefer',

        // EITHER associative option style (recommended):
        'options' => [
            PDO::ATTR_EMULATE_PREPARES => true,
        ],

        // OR numeric option style (also supported):
        // 'options' => [
        //     PDO::ATTR_EMULATE_PREPARES,
        // ],
    ],
],

User::where('is_active', true)->get();
bash
php artisan config:clear
php artisan cache:clear