naf / auth
Authentication and permission checks for NAF, with your own user model.
v0.2.1
2026-09-13 19:56 UTC
Requires
- php: >=8.3
- naf/framework: ^0.2
Requires (Dev)
- naf/orm: ^0.2
- naf/session: ^0.2
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^12.1
Suggests
- naf/orm: Use the shipped OrmProvider instead of writing your own.
- naf/session: Keep people signed in across requests.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-13 20:49:59 UTC
README
naf/auth
Log people in, and check what they may do — with your own user model.
auth()->authenticate(new PasswordCredentials($username, $password)); // sign in auth()->user(); // your own User object auth()->can('posts.edit'); // bool, guests included auth()->requireRole('admin'); // or a 403 leaves the controller
🧩 Part of the official NAF plugin collection. Install it when you need logins, and nothing else.
Documentation
Authentication and permissions →
Everything about this package — what it does, how it is configured and what it needs — lives in the NAF documentation. Not sure which packages you need? Start here.
Install
composer require naf/auth
License
MIT. Part of NAF.
