Download the PHP package gusmanwidodo/auth-kit without Composer
On this page you can find all versions of the php package gusmanwidodo/auth-kit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gusmanwidodo/auth-kit
More information about gusmanwidodo/auth-kit
Files in gusmanwidodo/auth-kit
Package auth-kit
Short Description A plugin-based authentication framework for Laravel, inspired by better-auth. Small core, extend everything via plugins.
License MIT
Homepage https://github.com/gusmanwidodo/auth-kit
Informations about the package auth-kit
Auth-Kit
A plugin-based authentication framework for Laravel, inspired by better-auth. Small core, extend everything via plugins that ship as separate Composer packages.
Philosophy
Like better-auth, the core does almost nothing on its own. It provides a plugin contract and a registry; features arrive as plugins. A plugin can:
- add HTTP endpoints (mounted under
/{prefix}/{plugin-id}/...) - extend the database schema (ship its own migrations)
- hook into the auth lifecycle with
before/afterhooks
Plugins are distributed as independent packages (e.g.
gusmanwidodo/auth-kit-otp),
so the ecosystem grows without touching the core.
Plugin registry
Official plugins maintained alongside the core. Each is a standalone Composer
package that only depends on auth-kit.
| Plugin | Package | Endpoints | Purpose |
|---|---|---|---|
| Credentials | gusmanwidodo/auth-kit-credentials |
POST /auth-kit/credentials/{register,login,forgot-password,reset-password} |
Identifier + password auth: register, login (email/phone/username), forgot/reset password. Hashed passwords, single-use hashed reset tokens, timing-safe |
| OTP | gusmanwidodo/auth-kit-otp |
POST /auth-kit/otp/issue, POST /auth-kit/otp/verify |
One-time-password issue/verify with a hashed code store and expiry hook |
| Magic Link | gusmanwidodo/auth-kit-magic-link |
POST /auth-kit/magic-link/request, GET /auth-kit/magic-link/consume |
Passwordless login via single-use, time-limited links with expiry hook |
| Permissions | gusmanwidodo/auth-kit-permissions |
POST /auth-kit/permissions/check |
Hybrid roles & permissions: static (zero-query) + dynamic (DB), polymorphic scoping, organization-ready. ~65× faster than spatie on the common check |
| Organization | gusmanwidodo/auth-kit-organization |
POST /auth-kit/organization/{create,invite,accept-invitation,set-active,check} + /teams/{create,add-member,check} |
Multi-tenant organizations, members, invitations, active-org, and nested teams. owner/admin/member and team lead/member as scoped roles via the permissions plugin |
| Social | gusmanwidodo/auth-kit-social |
/auth-kit/social/{provider}/{redirect,callback,link,unlink} |
OAuth / social login as a thin wrapper over Laravel Socialite. Multi-provider linked identities, encrypted tokens, login hooks |
| Two-Factor | gusmanwidodo/auth-kit-two-factor |
POST /auth-kit/two-factor/{enable,confirm,verify,disable,recovery-codes} |
TOTP 2FA (RFC 6238, zero-dependency): encrypted secrets, confirm-before-activate, single-use hashed recovery codes, replay protection |
Building a plugin? Add a row here in the same format so it is discoverable from the core.
Requirements
- PHP
^8.3 - Laravel 12
Installation
The service provider is auto-discovered. Publish the config if you want to tweak the route prefix or middleware:
How plugins work
A plugin is any class implementing AuthPlugin. Opt into extra capabilities by
also implementing the companion interfaces:
| Interface | Grants the plugin the ability to… |
|---|---|
AuthPlugin (required) |
have a unique id() and a boot() lifecycle hook |
HasRoutes |
register route files, auto-prefixed with the plugin id |
HasSchema |
ship migrations, auto-loaded by the core |
HasHooks |
run before / after logic on named lifecycle events |
Minimal plugin
Register it either from a package service provider (recommended, see the OTP
plugin) or in config/auth-kit.php:
The hook pipeline
Plugins implementing HasHooks return a map of event => callable. The core
runs them in registration order and any hook can short-circuit the rest:
Your code triggers the pipeline via the AuthManager:
Architecture
See docs/adr/001-plugin-based-architecture.md
for the design decision behind the plugin model, and
docs/adr/002-hybrid-access-control-model.md
for the access-control model used by the permissions plugin, and
docs/adr/003-organization-on-scoped-permissions.md
for how the organization plugin builds on scoped permissions, and
docs/adr/004-teams-as-nested-scope.md
for teams as a nested authorization scope, and
docs/adr/005-social-login-socialite-wrapper.md
for social login as a thin wrapper over Laravel Socialite, and
docs/adr/006-credentials-password-login-reset.md
for identifier + password login and password reset, and
docs/adr/007-two-factor-totp.md
for the self-implemented TOTP two-factor design.
Testing
License
MIT © Gusman Widodo. See LICENSE.
All versions of auth-kit with dependencies
illuminate/contracts Version ^12.0
illuminate/support Version ^12.0
illuminate/database Version ^12.0