orion-search / polaris
Orion tenancy from Polaris: the tenant is the active organization on the verified Polaris token
Requires
- php: >=8.3
- orion-search/core: ^1.0
- polaris/core: ^0.11
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-27 19:15:57 UTC
README
Orion tenancy from Polaris. The tenant is the active organization on the
verified Polaris access token (its org claim), read for every search and every index write.
composer require orion-search/polaris
use Orion\Polaris\ActiveOrganization; use Orion\Tenancy\Tenancy; $config = new Config( storage: $storage, engines: $engines, tenancy: Tenancy::resolvedBy(new ActiveOrganization(fn() => $currentRequest->getAttribute('polaris.token'))), );
The closure returns the current request's verified token (any Polaris\Contract\TokenInterface), or null. Without a
token, or with one that has no active organization (as Polaris issues right after login), resolving throws
Orion\Tenancy\NoTenant, and nothing is searched or recorded.
Every index then declares an org key (org_key in its search: manifest). Orion stamps it from the token on every
write and filters on it beneath every query, the escape hatch included. The Univeros module (univeros/orion) wires
all of this when univeros/polaris is installed.
Tenancy in depth, with or without Polaris: the Multi-tenancy guide.