mini\auth() Function

Documentation

Get the Auth facade instance

Returns the Auth facade with convenience methods. The facade delegates to the configured AuthInterface implementation.

Usage: auth()->requireLogin(); auth()->requireRole('admin'); if (auth()->isAuthenticated()) { ... } $userId = auth()->getUserId();

Signature

function auth(): mini\Auth\Auth

Returns

mini\Auth\Auth

Source

src/Auth/functions.php:34-37