PHPackages                             phphleb/hlogin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. phphleb/hlogin

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

phphleb/hlogin
==============

Registration module for the HLEB2 project

v2.0.12(4mo ago)3191MITPHPPHP &gt;=8.2.0

Since Oct 2Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/phphleb/hlogin)[ Packagist](https://packagist.org/packages/phphleb/hlogin)[ RSS](/packages/phphleb-hlogin/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (53)Used By (0)

HLOGIN
------

[](#hlogin)

---

[![HLEB2](https://camo.githubusercontent.com/838b21da13ac6fa4384590a6a151d564a2832887c0a085cd911223d700ca379c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f484c45422d322d6461726b6379616e)](https://github.com/phphleb/hleb) [![PHP](https://camo.githubusercontent.com/b5d4f7901c58ad1ddfff679966f426cc25a9354bab763846b9a7276c2feab4e0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e322d626c7565)](https://camo.githubusercontent.com/b5d4f7901c58ad1ddfff679966f426cc25a9354bab763846b9a7276c2feab4e0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e322d626c7565) [![License: MIT](https://camo.githubusercontent.com/fdf4c838e998efe42a2cfb3c27b8addedc9f7ddd1ecfecc4b19254f784232b7a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542532302846726565292d627269676874677265656e2e737667)](https://github.com/phphleb/hleb/blob/master/LICENSE)

The HLOGIN library expands the capabilities of the [HLEB2](https://github.com/phphleb/hleb) framework by adding full-fledged user registration on the site which is characterized by simplicity of settings and quick installation and (at the same time) convenient and diverse functionality that supports multilingualism and several design options. Optionally you can display a feedback form that goes in addition to registration and authorization. In the automatically created admin panel you will find tools for user management and display settings. After that you can immediately direct your thoughts to creating content for the site.

Supported **MySQL** / **MariaDB** / **PostgreSQL** / **SQLite**

Required PHP extensions: **json**, **gd**, **pdo**, **pdo-mysql** / **pdo-pgsql** / **pdo-sqlite**, **readline**

[**Link to instructions**](https://hleb2framework.ru)

[**Demo site**](https://auth2.phphleb.ru/)

### Installation

[](#installation)

Step 1. Installation via Composer into an existing HLEB2 project:

```
$ composer require phphleb/hlogin
```

Step 2. Installing the library into the project. You will be asked to choose a design from several:

```
$ php console phphleb/hlogin add
```

```
$ composer dump-autoload
```

### Connection

[](#connection)

Step 3. Before doing this action you must have a valid connection to the database. In the project settings `/config/database.php` you need to specify the connection and specify its name there in the `base.db.type` option. After that the console command creates the necessary tables and a user with administrator rights (you will be prompted to specify an E-mail and password):

```
$ php console hlogin/create-login-table
```

```
$ php console hlogin/create-admin
```

If it is not possible to execute a console command, then create tables using an SQL query from the `/vendor/phphleb/hlogin/planB.sql` file. After that, register an administrator and set his *regtype* equal to 11.

Step 4. Now you can go to the main stub page of the site if it is installed without changes and make sure that the authorization panels are available. If the library is not installed in the developed project on the HLEB2 framework from the beginning you should check the entry on the `/en/login/action/enter/` page of the site.

Step 5. Setting up registration on the site on specific pages through routing. To do this you need to set the following conditions in the routing files (project folder `/routes/`):

```
use App\Middlewares\Hlogin\Registrar;
use Phphleb\Hlogin\App\RegType;

Route::toGroup()->middleware(Registrar::class, data: [RegType::UNDEFINED_USER, '>=']);
// Routes in this group will be available to all unregistered and registered users except those that were marked deleted and banned.
Route::endGroup();

Route::toGroup()->middleware(Registrar::class, data: [RegType::PRIMARY_USER, '>=']);
// Routes in this group will be available to those who pre-registered (but didn't confirm E-mail), as well as to all registered users (including administrators).
Route::endGroup();

Route::toGroup()->middleware(Registrar::class, data: [RegType::REGISTERED_USER, '>=']);
// Routes in this group will be available to all users who have completed full registration (confirmed by E-mail including administrators).
Route::endGroup();

Route::toGroup()->middleware(Registrar::class, data: [RegType::REGISTERED_COMMANDANT, '>=']);
// Routes in this group will be available only to administrators.
Route::endGroup();

Route::toGroup()->middleware(Registrar::class, data: [RegType::PRIMARY_USER, '>=', Registrar::NO_PANEL]);
// Routes with check registration without displaying standard panels and buttons.
Route::endGroup();

Route::toGroup()->middleware(Registrar::class, data: [RegType::PRIMARY_USER, '>=', Registrar::NO_BUTTON]);
// Routes with check registration without displaying standard buttons.
Route::endGroup();
```

It should be borne in mind that pages that don't fall into any of these groups with conditions are outside the registration rules and this library is not connected to them.

Step 6. Configuration. After authorization in the administrator profile (`/en/login/profile/`) the login button to the admin panel is displayed. You can configure registration panels and other conditions there.

If you need to display data depending on the type of user registration you can use the following checks:

```
use Phphleb\Hlogin\App\AuthUser;

$user = AuthUser::current();
if ($user) {
    // Status for the confirmed user.
    $confirm = $user->isConfirm();

    // Obtaining the user's E-mail.
    $email = $user->getEmail();

    // Result of the administrator check.
    $isAdmin = $user->isSuperAdmin();
    // ... //
} else {
    // The current user is not authorized.
}
```

---

**More detailed information in the [framework documentation](https://hleb2framework.ru/)**.

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance78

Regular maintenance activity

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~30 days

Recently: every ~104 days

Total

52

Last Release

121d ago

Major Versions

v1.2.44 → v2.0.02024-01-29

PHP version history (4 changes)v1.0PHP ^7.0.0

v1.1PHP &gt;=7.0.0

v1.2PHP &gt;=7.4.0

v2.0.0PHP &gt;=8.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/add493abc37e54c44eabe920dd9facf7aae69955c84bb8245b561f3fc51708da?d=identicon)[phphleb](/maintainers/phphleb)

---

Top Contributors

[![phphleb](https://avatars.githubusercontent.com/u/48386098?v=4)](https://github.com/phphleb "phphleb (84 commits)")

### Embed Badge

![Health badge](/badges/phphleb-hlogin/health.svg)

```
[![Health](https://phpackages.com/badges/phphleb-hlogin/health.svg)](https://phpackages.com/packages/phphleb-hlogin)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[beatswitch/lock

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
