PHPackages                             phoxphp/auth - 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. phoxphp/auth

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

phoxphp/auth
============

PhoxPHP Authentication Component

v1.1.2(7y ago)2671PHPPHP &gt;=7.0.6

Since May 5Pushed 7y ago1 watchersCompare

[ Source](https://github.com/PhoxPHP/Auth)[ Packagist](https://packagist.org/packages/phoxphp/auth)[ RSS](/packages/phoxphp-auth/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (4)Dependencies (2)Versions (6)Used By (1)

PhoxPHP Authentication Component
--------------------------------

[](#phoxphp-authentication-component)

**Features:**

1. Register
2. Login
3. Logout
4. Activate account
5. Block account
6. Delete account
7. Change password

#### Register

[](#register)

To register a user, you use the register method which requires just three parameters. Namely:

1. email
2. password
3. verifyPassword

When registering a user, you can login automatically after registration by setting **auto\_login** to *true* in the configuration settings.

```
    // calling it as a registered service
    $auth = app()->load('auth');

    // registering a user
    $auth->register(
        'example@email.com',
        'password',
        'password'
    );

    // If auto_login is not enabled then you can login manually
    $auth->login(
        'example@email.com',
        'password'
    );
```

#### Login

[](#login)

The **login** method is used to log a user in. To redirect automatically after a user has been logged in, you need to set **auto\_redirect** to true in the configuration settings.

```
        // calling it as a registered service
        $auth = app()->load('auth');

        // log user in
        $auth->login(
            'example@email.com',
            'password'
        );
```

#### Logout

[](#logout)

```
    $auth = app()->load('auth');
    $auth->logout();
```

#### Activate account

[](#activate-account)

To activate an account, you need to use the **activateAccount**. This method requires just one parameter which is the user's confirmation\_code. By default, a user's account is not activated when registered but you can allow auto activation by setting **auto\_activate** to true in the configuration settings.

```

        // calling as registered service
        $auth = app()->load('auth');

        $confirmation_code = '********';
        $auth->activateAccount($confirmation_code);
```

#### Block account

[](#block-account)

To block an account, you need to use **blockAccount** method. This method requires just one parameter which must either be the user's email or the user's id.

```
        // calling as registered service
        $auth = app()->load('auth');

        // Blocking account using email
        $auth->blockAccount(
            'user@email.com'
        );

        // Blocking account using id
        $userId = 5;
        $auth->blockAccount($userId);
```

#### Unblock account

[](#unblock-account)

To unblock an account, you need to use **unblockAccount** method. This method requires just one parameter which must either be the user's email or the user's id just like the **blockAccount** method.

```
        // calling as registered service
        $auth = app()->load('auth');

        // Blocking account using email
        $auth->unblockAccount(
            'user@email.com'
        );

        // Blocking account using id
        $userId = 5;
        $auth->unblockAccount($userId);
```

#### Delete account

[](#delete-account)

To delete an account, use the **deleteAccount** method. It requires a single parameter which must either be the user's email or the user's id. This method returns *true* if the account deleted successfully.

```
        // calling as registered service
        $auth = app()->load('auth');

        // Delete account using email
        $auth->deleteAccount(
            'user@email.com'
        );

        // Delete account using id
        $userId = 5;
        $auth->deleteAccount($userId);
```

#### Change password

[](#change-password)

To update a user's password, you can use the **changePassword** method. The method requires two parameters which namely:

1. oldPassword
2. newPassword

The first parameter (oldPaasword) must be the user's current password and the second parameter (newPassword) must be the new password. This method returns *true* if the password changed successfully.

```
        // calling as registered service
        $auth = app()->load('auth');

        $oldPassword = 'old-password';
        $newPassword = 'new-password';

        $auth->changePassword(
            $oldPassword,
            $newPassword
        );
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

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 ~27 days

Total

4

Last Release

2890d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4277f23b95ffc8ed7f0817298964e6ae30eb67ec62d62e2f3208a9522bc319f6?d=identicon)[PhoxPHP](/maintainers/PhoxPHP)

---

Top Contributors

[![Peter2962](https://avatars.githubusercontent.com/u/18626464?v=4)](https://github.com/Peter2962 "Peter2962 (20 commits)")

---

Tags

authauthenticationphoxphpphoxphp-frameworkphpAuthenticationPHP7

### Embed Badge

![Health badge](/badges/phoxphp-auth/health.svg)

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

###  Alternatives

[kinde-oss/kinde-auth-php

Kinde PHP SDK for authentication

2280.2k3](/packages/kinde-oss-kinde-auth-php)[andalisolutions/oauth2-anaf

Anaf OAuth 2.0 support for the PHP League's OAuth 2.0 Client

195.9k](/packages/andalisolutions-oauth2-anaf)

PHPackages © 2026

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