- Is hendrahuang/cassandra-bundle actually a Laravel package?
- No. Despite being described as a Laravel package, it is a Symfony2/Symfony3 bundle that ships a Bundle subclass, a DI Extension with a TreeBuilder config tree, and YAML service definitions consumed by the Symfony kernel at boot. Laravel has no bundle registration and does not read Resources/config/services.yml, so Composer will not auto-discover it into a Laravel app. The reusable value is the thin wrapper around datastax/php-driver, not the framework glue.
- How do I install this Cassandra package in a Laravel application?
- You cannot simply composer require it and expect it to work in Laravel. The package targets Symfony's dependency injection container, so every service it defines would have to be re-registered manually in an Illuminate\Support\ServiceProvider. The practical path is to harvest its config schema and session-construction pattern and build a first-party CassandraServiceProvider plus config/cassandra.php.
- What PHP extension does this package require to talk to Cassandra?
- It depends on datastax/php-driver, which is only a Composer stub for the PECL cassandra C extension. That extension links against the DataStax C++ driver, so adoption is not a Composer operation. You need a PECL build in every image, a compiled toolchain in CI, and matching PHP ABI versions.
- Does this bundle support Laravel 10 or Laravel 11?
- Not natively. The Symfony-side code targets Symfony 2 and 3 conventions, and the last release was 2019-04-15. A Laravel 10 or 11 target running PHP 8.1+ has a real chance of having no working extension build at all. This must be verified as a go/no-go gate before any design work.
- How do I configure contact points, keyspace, and consistency level?
- The bundle exposes these through its DI Extension config tree, covering contact points, port, keyspace, consistency level, retry policy, and timeouts. In Laravel you would replicate the same surface in config/cassandra.php and bind a CassandraSession singleton from a service provider. That keeps the configuration familiar while dropping the Symfony machinery.
- Can I use this package with ScyllaDB, Astra, or a managed Cassandra service?
- The bundle is only a wrapper around the deprecated DataStax PHP driver, so compatibility depends on that driver and your cluster's CQL protocol support. If you are on ScyllaDB or a managed service like Astra or DataStax, a pure-PHP CQL client may be a better escape hatch than a PECL build. Verify driver availability against your target cluster before committing to this approach.
- What is the best alternative to this bundle for Laravel Cassandra integration?
- Harvest the useful parts instead of adopting the dependency. Take its config schema for contact points, port, keyspace, consistency level, retry policy, and timeouts, plus its session-construction pattern. Then build a first-party CassandraServiceProvider and a CassandraSession binding, and hide the extension behind a CassandraClient interface. For write-heavy or time-series data, direct CQL from a repository layer is often narrower and safer.
- Is this package maintained and safe to use in production?
- Treat it with caution. It has roughly 8 stars, 0 dependents, and a last release date of 2019-04-15, making it a bus-factor-1 artifact with no downstream validation. The DataStax PHP driver itself is deprecated, with releases stalled around the PHP 7.x era. It is best treated as a design reference rather than a production dependency.
- How do I test Cassandra integration in a Laravel application?
- Start with a throwaway Laravel app in a container that has the PECL cassandra extension built, to prove the runtime actually works. Hide the driver behind a CassandraClient interface so the C extension is swappable and your repository layer can be tested with a fake client. Only after that spike should you use it in one bounded context and roll out gradually.
- How much work is it to port this Symfony bundle to Laravel?
- Less than you might expect, because the bundle logic is slim: a session factory, keyspace configuration, and possibly a profiler data collector and pagination helper. Porting the useful surface into a ServiceProvider plus config/cassandra.php is roughly a few hundred lines of work. The larger cost is owning the PECL driver build and upgrade path internally, not the port itself.