PHP code example of churakovmike / laravel-clickhouse

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

    

churakovmike / laravel-clickhouse example snippets

 
composer 

composer 

    'providers' => [
        ...
        \ChurakovMike\LaravelClickHouse\ClickhouseServiceProvider::class,
        ...
    ]

'connections' => [
    'clickhouse' => [
        'driver' => 'clickhouse',
        'host' => 'http://127.0.0.1',
        'port' => 8123,
        'database' => 'database_name',
        'username' => 'default',
        'password' => '',
        'options' => [
            'timeout' => 10,
        ]
    ]
]



namespace App;

use ChurakovMike\LaravelClickHouse\Database\Model;

class Events extends Model
{
    // ...
}