illuminatech/db-role
Laravel package for managing database roles per connection, letting you switch the active role at runtime to enforce permissions, read-only access, and tenant isolation without opening extra connections.
db-role implements class-table inheritance, so this becomes a first-class schema choice rather than a JSON blob or an EAV table.hasOne relations plus save orchestration, adopt a package, or model roles as separate aggregates joined by policy logic? This package is a concrete reference implementation of option two.Consider it only when all of the following hold:
NOASSERTION, which means the license is unstated or unrecognized. This is a hard blocker for most legal/procurement processes until clarified with the maintainer.Look elsewhere when: role differences are a handful of fields (use JSON or nullable columns), you need polymorphic behavior across unrelated tables (native morphTo), you rely on a reporting layer that expects one wide table, you operate under compliance/audit regimes that require a clear license and vendor support, or you have no capacity to maintain a fork. In those cases, implement the pattern in-house or use a single-table inheritance package.
For executives: This is not a procurement recommendation. illuminatech/db-role is a small, low-adoption open-source library that demonstrates a proven database pattern — class-table inheritance — for entities that play multiple roles. Its value to us is as a design reference that de-risks the architecture decision for our upcoming multi-role domain work, not as a production dependency. Adopting it directly carries unacceptable licensing ambiguity (NOASSERTION) and single-maintainer risk.
For engineering: The package shows a clean way to give an Eloquent model multiple role relations that share a primary key, with persistence handled through the role model. It is worth a short time-boxed spike against our real schema to validate the pattern — measure query complexity, eager-loading behavior, and migration ergonomics. If the pattern proves out, our recommendation is to implement a thin internal equivalent (~a trait and a relation class) that we own outright, carrying our license and tests. Budget: one engineer, one to two weeks, including a fork-or-reimplement decision. Decision needed: approve the spike, and rule the package out as a direct dependency.
How can I help you explore Laravel packages today?