composer require jrsaunders/shard-matrix
Then publish/configure the package config. Check the README for the exact publish command/tag; the important artifact is the YAML shard map, typically config/shard-matrix.yaml.config/database.php first. The YAML should reference those Laravel connection names, not raw credentials, so env-specific hosts/passwords stay in Laravel config.orders or events keyed by tenant_id/account_id: create the table on each shard, insert through the shard-aware builder, then query by the same shard key.DB::table() or DB::connection().tenant_id, account_id, user_id. Avoid mutable keys like status, email, or created date. Every hot-path query should include the shard key.DB::table(...) via the package’s builder over plain Eloquent unless the package documents an Eloquent trait/model integration. Eloquent relationships across shards will not work transparently.config/database.php, and log the resolved shard key -> connection mapping in non-production.whereIn across tenants are not magically solved. Design around them with denormalized read tables, fan-out services, or a reporting warehouse.DB::transaction() will not make it atomic.toSql() plus the connection name in tests.php artisan config:clear). If the package caches the shard map, clear that cache too.How can I help you explore Laravel packages today?