- Is intaro/hstore-bundle compatible with Laravel?
- No, it is a Symfony bundle, not a Laravel package. It registers a Doctrine DBAL hstore type through Intaro\HStoreBundle\IntaroHStoreBundle, with no service provider, facade, or package discovery manifest. In a standard Eloquent app Composer can install it, but it adds no runtime behavior. Use it only as a reference implementation or port the type class.
- How do I install intaro/hstore-bundle with Composer?
- Running composer require intaro/hstore-bundle is technically possible because the package is MIT licensed and autoloadable. In Symfony you register Intaro\HStoreBundle\IntaroHStoreBundle in AppKernel or bundles.php. In Laravel there is no register or boot path, so installation alone does nothing. The package is marked deprecated, so prefer vendoring the type logic if you need it.
- Does this package support Laravel 10 or Laravel 11?
- No official Laravel version support exists, and the package was last updated in 2014, before modern Laravel. It predates PHP 8 and Doctrine DBAL 3 and 4, so its type signatures are outdated. Laravel 10 or 11 compatibility would require a port, not a version constraint change. Treat any Laravel use as a custom implementation.
- How do I configure hstore columns in Doctrine with this bundle?
- In Symfony you enable the bundle, and the Doctrine DBAL type named hstore becomes available for entity mappings. Columns are declared as hstore and convert to and from PHP arrays. The bundle handles type registration through its container extension. In Laravel you would need to call Type::addType yourself.
- How do I use hstore with Laravel Eloquent instead?
- Eloquent uses PDO, so hstore columns surface as raw strings unless you add a cast or accessor. There is no Eloquent integration, and the bundle's Doctrine type is not reached by Eloquent queries. You can add a custom cast that parses the hstore text format, or better, use jsonb with $casts = ['meta' => 'array']. If you use laravel-doctrine/orm, you can register a ported HStoreType.
- How do I port intaro/hstore-bundle to Laravel?
- Vendor the small DBAL type class that implements getSQLDeclaration, convertToDatabaseValue, convertToPHPValue, getName, and requiresSQLCommentHint into app/Doctrine/Types/HStoreType.php. Register it in AppServiceProvider::boot() with Type::addType('hstore', HStoreType::class). If you use Doctrine ORM, also call registerDoctrineTypeMapping('hstore', 'hstore') on the platform. This is a small, same-day task for one engineer, but only relevant on a Doctrine stack.
- What PostgreSQL setup does hstore require?
- The PostgreSQL hstore extension must be installed with CREATE EXTENSION hstore. On managed services such as RDS, Cloud SQL, or Supabase this may require an extension allowlist or parameter group change. The bundle does not install the extension for you. hstore stores a flat text-to-text map, so all values round-trip as strings.
- Can I test hstore code with SQLite or an in-memory database?
- No, hstore is PostgreSQL-specific and the DBAL type emits PostgreSQL SQL. Tests need a real PostgreSQL instance with the hstore extension enabled. SQLite or in-memory databases will not validate the type's schema declaration or array conversion. Use a containerized PostgreSQL service in CI for accurate coverage.
- Is intaro/hstore-bundle maintained and safe for production?
- It is explicitly deprecated and has had no commits since 2014, with no PHP 8 or Doctrine DBAL 3 or 4 updates. It has a very small install base, so there is little regression signal and no active issue triage. The MIT license makes vendoring low-risk legally, but you own any fixes. For new production work, avoid the dependency and use jsonb or a maintained custom type.
- What are the best alternatives to hstore for key-value data in Laravel?
- PostgreSQL jsonb is the usual replacement, available since 9.4 and supported natively by Eloquent array casts. It supports nested structures and GIN indexing without an hstore-specific operator class. If you must stay on Doctrine, port the type or use a maintained Doctrine JSON type. Only use hstore when an existing schema already depends on it.