Search by

naf / auth

floknapp

Authentication and permission checks for NAF, with your own user model.

Package info

github.com/nafphp/auth

Type:naf-plugin

pkg:composer/naf/auth

Statistics

Installs: 115

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

v0.2.1 2026-09-13 19:56 UTC

This package is auto-updated.

Last update: 2026-09-13 20:49:59 UTC


README

NAF

NAF Auth Plugin

← Back to NAF

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.