PHP code example of pixelvide / laravel-iam-db-auth

1. Go to this page and download the library: Download pixelvide/laravel-iam-db-auth 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/ */

    

pixelvide / laravel-iam-db-auth example snippets


 [
    'mysql' => [
        'driver' => 'mysql',
        'host' => env('DB_HOST', '127.0.0.1'),
        'port' => env('DB_PORT', '3306'),
        'database' => env('DB_DATABASE', 'database_name'),
        'username' => env('DB_USERNAME', 'database_username'),
        'password' => '',
        'charset' => 'utf8mb4',
        'collation' => 'utf8mb4_unicode_ci',
        'prefix' => '',
        'strict' => false,
        'engine' => null,
        'aws_region' => env('AWS_REGION'),
        'use_iam_auth' => env('DB_USE_IAM_AUTH', true),
        'options' => array(
            'MYSQLI_READ_DEFAULT_FILE' => env('MYSQL_CNF_FILE', '/path/to/cnf/file'),
            PDO::MYSQL_ATTR_SSL_CA    => base_path('vendor/pixelvide/laravel-iam-db-auth/certs/rds-ca-2019-root.pem'),
        ),
    ],
];

 [
    'pgsql' => [
        'driver' => 'pgsql',
        'host' => env('DB_HOST', '127.0.0.1'),
        'port' => env('DB_PORT', '5432'),
        'database' => env('DB_DATABASE', 'database_name'),
        'username' => env('DB_USERNAME', 'database_username'),
        'password' => '',
        'charset' => 'utf8mb4',
        'aws_region' => env('AWS_REGION'),
        'use_iam_auth' => env('DB_USE_IAM_AUTH', true),
        'options' => array(
            PDO::ATTR_PERSISTENT => env('DB_PERSISTENT', false),      
        ),
    ],
];