PHPackages                             dbyzero/laravel-cassandra - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. dbyzero/laravel-cassandra

ActiveLibrary[Database &amp; ORM](/categories/database)

dbyzero/laravel-cassandra
=========================

A Cassandra based Eloquent model and Query builder for Laravel (Casloquent)

2111PHP

Since Mar 23Pushed 8y agoCompare

[ Source](https://github.com/dbyzero/laravel-cassandra)[ Packagist](https://packagist.org/packages/dbyzero/laravel-cassandra)[ RSS](/packages/dbyzero-laravel-cassandra/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (2)Used By (0)

Laravel Cassandra
=================

[](#laravel-cassandra)

[![Build Status](https://camo.githubusercontent.com/d9a8cd4146ad0bb0a2b46e48c3342efec82d09836afec5757812f059491c2db3/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4675697461642f6c61726176656c2d63617373616e6472612f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Fuitad/laravel-cassandra/build-status/master) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/27cb374e96b5041e4251da0f3c1f8a360e2281d4122cd21832eed65b9531f37a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4675697461642f6c61726176656c2d63617373616e6472612f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Fuitad/laravel-cassandra/?branch=master) [![Donate](https://camo.githubusercontent.com/d47cdb766a100070d38a702d9c7760ccc8052063484e1478a26bcd16680d33af/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f6e6174652d70617970616c2d626c75652e737667)](https://www.paypal.me/fuitad)

A Cassandra based Eloquent model and Query builder for Laravel (Casloquent)

**WARNING**: This is a work in progress... not ready for usage yet.

Installation
------------

[](#installation)

### Laravel version Compatibility

[](#laravel-version-compatibility)

LaravelPackage5.4.xdev-masterMake sure you have the Cassandra PHP driver installed (version 1.2+). You can find more information at .

Installation using composer:

```
composer require fuitad/laravel-cassandra

```

And add the service provider in `config/app.php`:

```
fuitad\LaravelCassandra\CassandraServiceProvider::class,
```

(haven't tested with Lumen yet... TODO)

The service provider will register a cassandra database extension with the original database manager. There is no need to register additional facades or objects. When using cassandra connections, Laravel will automatically provide you with the corresponding cassandra objects.

For usage outside Laravel, check out the [Capsule manager](https://github.com/illuminate/database/blob/master/README.md) and add:

```
$capsule->getDatabaseManager()->extend('cassandra', function($config)
{
    return new fuitad\LaravelCassandra\Connection($config);
});
```

Configuration
-------------

[](#configuration)

Change your default database connection name in `config/database.php`:

```
'default' => env('DB_CONNECTION', 'cassandra'),
```

And add a new cassandra connection:

```
'cassandra' => [
    'driver'   => 'cassandra',
    'host'     => env('DB_HOST', 'localhost'),
    'port'     => env('DB_PORT', 9142),
    'keyspace' => env('DB_DATABASE'),
    'username' => env('DB_USERNAME'),
    'password' => env('DB_PASSWORD'),
],
```

You can connect to multiple servers with the following configuration:

```
'cassandra' => [
    'driver'   => 'cassandra',
    'host'     => ['server1', 'server2'],
    'port'     => env('DB_PORT', 9142),
    'keyspace' => env('DB_DATABASE'),
    'username' => env('DB_USERNAME'),
    'password' => env('DB_PASSWORD'),
],
```

Eloquent
--------

[](#eloquent)

TODO

Query Builder
-------------

[](#query-builder)

The database driver plugs right into the original query builder. When using cassandra connections, you will be able to build fluent queries to perform database operations.

```
$users = DB::table('users')->get();

$user = DB::table('users')->where('name', 'John')->first();
```

If you did not change your default database connection, you will need to specify it when querying.

```
$user = DB::connection('cassandra')->table('users')->get();
```

Read more about the query builder on

Credits
-------

[](#credits)

A lot of the logic behind this package is borrowed from the great [Laravel-MongoDB](https://github.com/jenssegers/) package.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b196f48a48a710f1aaddabfafb5c7952ebb3f75b0d2f81e37b4288219522b6f7?d=identicon)[dbyzero](/maintainers/dbyzero)

---

Top Contributors

[![dbyzero](https://avatars.githubusercontent.com/u/2214094?v=4)](https://github.com/dbyzero "dbyzero (2 commits)")[![Fuitad](https://avatars.githubusercontent.com/u/263288?v=4)](https://github.com/Fuitad "Fuitad (1 commits)")

### Embed Badge

![Health badge](/badges/dbyzero-laravel-cassandra/health.svg)

```
[![Health](https://phpackages.com/badges/dbyzero-laravel-cassandra/health.svg)](https://phpackages.com/packages/dbyzero-laravel-cassandra)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
