GeezerVison is showing escalated.dev — User Model Configuration / User ModelUser Model
Your user model must implement the Ticketable contract so Escalated can associate tickets with users.
User key types (UUID / string IDs)
Escalated stores references to your application's users (a ticket's requester
and assignee, a reply's author, an activity's causer, and so on). By default it
assumes your user primary key is an integer, which matches most apps.
If your users table uses a UUID or other string primary key, Escalated still
works — you just tell it the key type so the columns that store a user reference
are created to match. Integer-keyed apps need no change; everything below
defaults to the existing integer behavior, so this is a non-breaking, opt-in
setting.
| Framework |
How to enable UUID / string user keys |
| Laravel / Filament |
ESCALATED_USER_KEY_TYPE env (or config/escalated.php → user_key_type). Default auto detects the type from your User model's key (int → bigint, HasUuids → uuid, HasUlids → ulid); override with bigint/uuid/ulid/string. |
| NestJS |
ESCALATED_USER_KEY_TYPE env: int (default), bigint, uuid, or string. Read at startup since TypeORM column types are fixed at load time. |
| AdonisJS |
ESCALATED_USER_KEY_TYPE env: int (default), bigint, uuid, or string. Set it before running the Escalated migrations. |
| Rails |
config.user_id_type in the initializer. Default :auto introspects your user_class primary key; override with :bigint/:uuid/:string. Re-run escalated:install:migrations after changing it. |
| Symfony |
ESCALATED_USER_KEY_TYPE env: int (default), bigint, uuid, or string. Generate a Doctrine migration after changing it. |
| Phoenix |
config :escalated, user_key_type: :integer (default), :binary_id (UUID), or :string. Compile-time config — recompile the dependency after changing it. |
| Go |
ESCALATED_USER_KEY_TYPE env: int (default), bigint, uuid, or string. Host user IDs are exposed as the string-friendly models.UserID type. |
| Django |
Automatic — references use ForeignKey(AUTH_USER_MODEL) / CharField, so any integer, UUID, or string user primary key works with no configuration. |
| .NET |
Automatic — host user IDs are exchanged as string throughout, so integer, Guid, or string user keys all work. Your IUserDirectory implementation uses string IDs. |
| Spring |
Automatic — the optional host-user link columns are stored as strings, so a UUID/string user key can be linked. |
| WordPress |
Not applicable — WordPress user IDs are always integers. |
For UUID and string key types, user-reference columns are created as a portable
string column (for example varchar(255)) that holds a UUID or a stringified
integer ID. Existing integer-keyed installations are unaffected by the default.
use Escalated\Laravel\Contracts\HasTickets;
use Escalated\Laravel\Contracts\Ticketable;
class User extends Authenticatable implements Ticketable
{
use HasFactory, HasTickets, Notifiable;
}
The HasTickets trait provides a tickets() relationship and helper methods on the user model.
class User < ApplicationRecord
include Escalated::Ticketable
end
Django uses AUTH_USER_MODEL automatically. No changes needed to your user model.
// The AdonisJS package uses your configured userModel
// from config/escalated.ts — no trait needed.
// Users are linked via the foreign key on the tickets table.
Configure the user model import path in config/escalated.ts under userModel.
use Escalated\Laravel\Contracts\HasTickets;
use Escalated\Laravel\Contracts\Ticketable;
class User extends Authenticatable implements Ticketable
{
use HasFactory, HasTickets, Notifiable;
}
Filament uses the same escalated-laravel user model setup since it's a Laravel package wrapper.
WordPress uses its native user system automatically. Tickets are linked to WordPress user IDs -- no changes to your user model are required. Guest ticket support is available for unauthenticated users via secure access tokens.
The Flutter package retrieves user data from your backend API via the auth hooks system. There is no local User model to configure — authentication and user resolution happen server-side.
Auth Hooks
Override AuthHooks to plug in your own authentication logic:
class MyAuthHooks extends AuthHooks {
@override
Future<AuthResult> onLogin(String email, String password) async {
// Call your auth API, return token + user info
final response = await myAuthService.login(email, password);
return AuthResult(
token: response.token,
user: AuthUser(
name: response.user.name,
email: response.user.email,
),
);
}
@override
Future<void> onLogout() async {
await myAuthService.logout();
}
}
Pass your hooks to the config:
EscalatedConfig(
apiBaseUrl: 'https://yourapp.com/support/api/v1',
authHooks: MyAuthHooks(),
)
Note: The package sends a Bearer token with every API request. Your backend's Ticketable user model handles the rest.
The React Native package retrieves user data from your backend API via the auth hooks system. There is no local User model to configure — authentication and user resolution happen server-side.
Auth Hooks
Provide custom auth callbacks through the provider config:
import { EscalatedProvider, AuthHooks } from '@escalated-dev/escalated-react-native';
const customHooks: AuthHooks = {
onLogin: async (email, password) => {
const response = await myAuthService.login(email, password);
return {
token: response.token,
user: { name: response.user.name, email: response.user.email },
};
},
onLogout: async () => {
await myAuthService.logout();
},
};
export default function App() {
return (
<EscalatedProvider config={{ apiBaseUrl: 'https://yourapp.com/support/api/v1', authHooks: customHooks }}>
{/* ... */}
</EscalatedProvider>
);
}
Note: The package sends a Bearer token with every API request. Your backend's Ticketable user model handles the rest.
|