New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

cybercog/laravel-clickhouse

ClickHouse migrations for Laravel
358,975 165
Install
composer require cybercog/laravel-clickhouse
Latest Version:0.2.1
PHP:^8.2
Laravel:11 · 12 · 13
Older releases:8 · 9 · 10
License:MIT
Last Updated:Jul 27, 2026
Links: GitHub  ·  Packagist
Maintainer: antonkomarev

Laravel ClickHouse

laravel-clickhouse

Discord Releases License

Introduction

Laravel ClickHouse database integration. This package includes generation and execution of the ClickHouse database migrations in the Laravel application.

Features

Installation

Pull in the package through Composer.

composer require cybercog/laravel-clickhouse

Setup

Add environment variables in .env file.

CLICKHOUSE_HOST=localhost
CLICKHOUSE_PORT=8123
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=
CLICKHOUSE_DATABASE=default

Configuration customization

Publish ClickHouse configuration.

php artisan vendor:publish --provider="Cog\Laravel\Clickhouse\ClickhouseServiceProvider" --tag=config

Edit config/clickhouse.php file.

Usage

ClickHouse client

You can use a singleton object smi2/phpClickHouse to query ClickHouse:

app(\ClickHouseDB\Client::class)->select(
    /* Query */
);

app(\ClickHouseDB\Client::class)->write(
    /* Query */
);

ClickHouse database migration

Create migration
php artisan make:clickhouse-migration create_example_table

New migration will be created in database/clickhouse-migrations directory.

Run migrations
php artisan clickhouse:migrate

To remove the interactive question during production migrations, you can use --force option.

php artisan clickhouse:migrate --force
Step

You can specify how many files need to be applied:

php artisan clickhouse:migrate --step=1

Value 0 is default — all files

Rollback migrations

Rolling back migrations is intentionally unavailable. Migrations should go only forward.

Changelog

Detailed changes for each release are documented in the CHANGELOG.md.

License

🌟 Stargazers over time

Stargazers over time

About CyberCog

CyberCog is a Social Unity of enthusiasts. Research the best solutions in product & software development is our passion.

CyberCog

Related Packages

tomzx/laravel-migration

A migration service based on Laravel Database package.

35 5
marcinkozak/databasemigrator

Tool to migrate from a database to another one.

19 1
aedart/athenaeum-database

Database utilities for Laravel

24,873 0
dbout/wp-orm

WordPress ORM with Eloquent.

11,224 133
gguney/rmigration

Reverse Migration for Laravel

3,733 3

Version History

Version Released PHP Laravel License
0.2.1 ^8.2 ^11.0|^12.0|^13.0 MIT
0.2.0 ^8.2 ^11.0|^12.0 MIT
0.1.0 ^7.4|^8.0 ^8.0|^9.0|^10.1.3|^11.0|^12.0 MIT