Search by

drago-ex / project-user

accgit

A small helper package for working with the authenticated user in Drago project.

Package info

github.com/drago-ex/project-user

Type:drago-tools-resource

pkg:composer/drago-ex/project-user

Statistics

Installs: 238

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v1.1.0 2026-11-05 18:01 UTC

This package is auto-updated.

Last update: 2026-11-15 03:05:58 UTC


README

The signed-in user of Drago Project with typed access to the identity data (username, email).

PHP version Coding Style

Requirements

Installation

composer require drago-ex/project-user

Project Tools copies the files of the package into app/Core/Security, where you adapt them. UserConf.neon replaces the Nette user service with App\Core\Security\CurrentUser, so $user in presenters and templates is CurrentUser.

Usage

use App\Core\Security\CurrentUser;
use Nette\DI\Attributes\Inject;

final class SomePresenter extends Presenter
{
	#[Inject]
	public CurrentUser $currentUser;
}
$identity = $currentUser->getUserIdentity();

echo $identity->username;
echo $identity->email;
{varType App\Core\Security\CurrentUser $user}
<p>{$user->getUserIdentity()->username}</p>

UserIdentityException is thrown when the identity data is missing or invalid. Extend UserIdentity with further fields your project stores in the identity.