jundayw/tokenable
jundayw/tokenable is a Laravel package that adds token support to Eloquent models, helping you generate and manage tokens for authentication or access control. A lightweight helper for token-based APIs and PHP applications.
User, Admin, Customer, Device each holding their own tokens) maps directly to product decisions about whether to model distinct actor types as separate authenticatable entities or as roles on one. That choice ripples into permissions, admin surfaces, audit logs, and API contracts — worth deciding deliberately, not by default.Consider it when:
Look elsewhere when:
tokenable already supports multiple models) and add a thin refresh-token layer yourself, or Laravel Passport if you genuinely need OAuth2/OIDC, scopes, and third-party clients.Bottom line: evaluate as an input, not a dependency. The high opportunity signal here is real (multi-model + refresh + multi-platform is a genuine gap between Sanctum and Passport), but the adoption signal is near zero. The correct PM move is a timeboxed spike against your own requirements, then either compose Sanctum + a small refresh layer or fork the parts you need.
To executives: Authentication is table stakes infrastructure, and we currently have no documented policy for how tokens are issued, refreshed, or revoked across web, mobile, and server-rendered clients. A small open-source package (jundayw/tokenable, MIT) demonstrates the exact shape of the gap between Laravel's two official options — Sanctum is simple but has no refresh rotation, Passport is capable but heavyweight. It is not a candidate to ship as a dependency: two GitHub stars, no downstream users, one maintainer, no security disclosure process. My recommendation is a one-to-two week engineering spike using it as a reference to either (a) confirm Sanctum plus a small in-house refresh layer meets our needs, or (b) justify a scoped fork we own. This is a low-cost decision that prevents us from either over-building OAuth2 we don't need or under-building session security we can't retrofit.
To engineering: Read the source before anything else. Validate specifically: how tokens are generated and hashed at rest, refresh-token rotation and reuse detection, revocation on logout and credential change, expiry and cleanup scheduling, and how guards resolve across multiple models. Assume no tests, no CI, and no upgrade path — that is the budget you are pricing in. Deliverable from the spike is a written recommendation plus a threat-model note, not a merged dependency.
To security: Treat this as untrusted third-party code. No CVE history, no disclosed review, no maintainer track record. Any adoption requires a full read-through and our own test suite before it touches a production credential path — and even then, the fork cost likely exceeds composing first-party components.
How can I help you explore Laravel packages today?