- laravel 7+
- php 7.4+
composer require churakovmike/laravel-clickhouse
If you need the latest version
composer require churakovmike/laravel-clickhouse:dev-main
In config/app.php
add:
'providers' => [
...
\ChurakovMike\LaravelClickHouse\ClickhouseServiceProvider::class,
...
]
Connection configures via config/database.php
Clickhouse default configuration example:
'connections' => [
'clickhouse' => [
'driver' => 'clickhouse',
'host' => 'http://127.0.0.1',
'port' => 8123,
'database' => 'database_name',
'username' => 'default',
'password' => '',
'options' => [
'timeout' => 10,
]
]
]
Create new own model and inherit from the new model
<?php
namespace App;
use ChurakovMike\LaravelClickHouse\Database\Model;
class Events extends Model
{
// ...
}
That's all, you can work with clickhouse using the familiar Eloquent model.
- Clusters switching
- Server switching
- Native clickhouse functions for the model (sumIf, countIf, quantilesTimingIf, argMinIf and etc.)
- New migration manager and new Blueprint for Clickhouse
- New data types for queries