Configurable database connection
Every model and migration resolved the host application's default connection, with no way to change it — which made the package unusable in any host that partitions its database: a schema shared with a legacy system, a multi-tenant split, a separate reporting store, or simply a host that would rather keep support tables out of its primary database.
// config/escalated.php
'connection' => env('ESCALATED_DB_CONNECTION'), // null = your app's default
null keeps the historical behaviour, so an unconfigured host is unchanged — the existing suite passes untouched.
This moves Escalated's models, migrations, query-builder reads and transactions together. It deliberately does not move your users table: that belongs to the host, and Escalated follows your user model to wherever it already lives.
Two things the setting alone does not solve
Both were found by the new tests rather than reasoned about up front, and both are the substance of this release.
Eloquent pushes the parent's connection onto related models. Once Escalated moved, a ticket's requester and assignee were being looked up in Escalated's database — no such table: users, because the host's users table was never over there. Propagation is now kept for Escalated's own models (so $ticket->setConnection('archive') still carries across our graph) and stops at the host's.
Four relations join an Escalated pivot to the host's users table — department agents, role members, skill agents, ticket followers — and no database can join across two connections. Those resolve in two steps when the connections differ: read the pivot, then load the users by key. ->agents, ->followers, eager loading, withCount(), attach()/sync()/detach() and pivot columns all behave the same. withCount() counts the pivot alone, which is also cheaper on a single connection. A pivot row whose host user was deleted is skipped rather than hydrated as a hole, since no cross-connection foreign key can cascade it away. On a single connection every override falls through to Eloquent and the ordinary JOIN is still issued.
Upgrading
Nothing to do unless you want it. Setting connection on an existing install does not move existing data — migrate the tables yourself, or run the package migrations against the new connection and copy the rows across, before pointing Escalated at it.
723 tests / 3,018 assertions. Pint clean.