PHPackages                             tatter/users - 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. tatter/users

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

tatter/users
============

User interfaces and provider for CodeIgniter 4

v1.3.0(4y ago)943.1k↓49.1%3[2 issues](https://github.com/tattersoftware/codeigniter4-users/issues)[1 PRs](https://github.com/tattersoftware/codeigniter4-users/pulls)3MITPHPPHP ^7.4 || ^8.0

Since Feb 21Pushed 2y ago4 watchersCompare

[ Source](https://github.com/tattersoftware/codeigniter4-users)[ Packagist](https://packagist.org/packages/tatter/users)[ Docs](https://github.com/tattersoftware/codeigniter4-users)[ Fund](https://paypal.me/tatter)[ GitHub Sponsors](https://github.com/tattersoftware)[ RSS](/packages/tatter-users/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (6)Dependencies (5)Versions (10)Used By (3)

Tatter\\Users
=============

[](#tatterusers)

User interfaces and provider for CodeIgniter 4

[![](https://github.com/tattersoftware/codeigniter4-users/workflows/PHPUnit/badge.svg)](https://github.com/tattersoftware/codeigniter4-users/actions/workflows/test.yml)[![](https://github.com/tattersoftware/codeigniter4-users/workflows/PHPStan/badge.svg)](https://github.com/tattersoftware/codeigniter4-users/actions/workflows/analyze.yml)[![](https://github.com/tattersoftware/codeigniter4-users/workflows/Deptrac/badge.svg)](https://github.com/tattersoftware/codeigniter4-users/actions/workflows/inspect.yml)[![Coverage Status](https://camo.githubusercontent.com/188f571a3f21c4288142303e168de5c6184a52e83bbdce057e39604789bd507b/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f746174746572736f6674776172652f636f646569676e69746572342d75736572732f62616467652e7376673f6272616e63683d646576656c6f70)](https://coveralls.io/github/tattersoftware/codeigniter4-users?branch=develop)

Quick Start
-----------

[](#quick-start)

1. Install with Composer: `> composer require tatter/users`
2. Check the list of supported factories or provide your own
3. Access users and their methods through the provided service:

```
$users = service('users'); // instance of Tatter\Users\UserFactory
$user  = $users->findByEmail('bill@example.com'); // instance of Tatter\Users\UserEntity
echo $user->getUsername(); // "billy_jean"

```

Description
-----------

[](#description)

Not an authentication module itself, `Tatter\Users` brings common interfaces and factory discovery to simplify user integration into other libraries and projects.

Installation
------------

[](#installation)

Install easily via Composer to take advantage of CodeIgniter 4's autoloading capabilities and always be up-to-date:

- `> composer require tatter/users`

Or, install manually by downloading the source files and adding the directory to `app/Config/Autoload.php`.

Configuration
-------------

[](#configuration)

The core of **Users** are the interfaces for User Entities and User Factories. Your project can use the built-in classes or provide its own implementation, and any library that uses `Tatter\Users` will then be able to work with your user classes. Currently the following libraries are supported natively and with discovery:

- [Myth:Auth](https://github.com/lonnieezell/myth-auth)
- [CodeIgniter Shield](https://github.com/lonnieezell/codigniter-shield) *(in development)*
- Agung Sugiarto's [CodeIgniter4 Authentication](https://github.com/agungsugiarto/codeigniter4-authentication)

Discovery will return the first `UserFactory` implementation it can locate with the following priorities:

1. A `UserFactory` implementation called "UserModel" returned by the framework's model factory. Equivalent to:

    $users = model('UserModel', \['instanceOf' =&gt; UserFactory::class\])
2. A discovered compatible library from `UserProvider`.

Note: If your implementation is not compatible with number one then you may supply it to the provider directly:

```
\Tatter\Users\UserProvider::addFactory(MyDiscoveryClass::class, MyFactory::class);

```

Usage
-----

[](#usage)

Once you have the necessary classes available the easiest way to access them is through the Users Service:

```
$users = service('users')->findByEmail('bill@example.com'); // instance of Tatter\Users\UserFactory
$user  = $users->findByEmail('bill@example.com'); // instance of Tatter\Users\UserEntity

```

Factories
---------

[](#factories)

The User Factory interface defines the following methods:

- findById()
- findByEmail()
- findByUsername()

Entities
--------

[](#entities)

The User Entity interface defines the following methods:

- getIdentifier()
- getId()
- getEmail()
- getUsername()
- getName()
- isActive()

There are extended interfaces in the `Tatter\Users\Interfaces` namespace that provide additional methods which may be required by some libraries. Check your library's requirements to make sure you are using all the required interfaces.

Testing
-------

[](#testing)

There are convenience test cases in `Tatter\Users\Test` to enable other libraries to add and test their own classes. If you are looking to test your user interfaces without committing to a specific provider then consider adding [Tatter\\Imposter](https://github.com/tattersoftware/codeigniter4-imposter) - a mock authentication library that is fully compliant with `Tatter\Users`.

Development
-----------

[](#development)

Pull Requests are accepted for additional libraries and adapters. Please include the appropriate tests and provider code if you wish to support discovery. Requests for additional implementations should be opened as a Feature Request Issue and fulfillment will depend on availability and sponsorship (see "Sponsor this project").

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 97.7% 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 ~89 days

Recently: every ~112 days

Total

6

Last Release

1463d ago

PHP version history (2 changes)v1.0.0PHP ^7.3 || ^8.0

v1.3.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ebe908b4fe73807ecdd9f88733342199c9991b7de800329f5b2b787c8210d62?d=identicon)[MGatner](/maintainers/MGatner)

---

Top Contributors

[![MGatner](https://avatars.githubusercontent.com/u/17572847?v=4)](https://github.com/MGatner "MGatner (42 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

authenticationcodeignitercodeigniter4usersAuthenticationcodeigniterUserscodeigniter4

### Embed Badge

![Health badge](/badges/tatter-users/health.svg)

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

###  Alternatives

[codeigniter4/shield

Authentication and Authorization for CodeIgniter 4

417372.4k22](/packages/codeigniter4-shield)[myth/auth

Flexible authentication/authorization system for CodeIgniter 4.

641147.9k14](/packages/myth-auth)[agungsugiarto/boilerplate

CodeIgniter4 Boilerplate based on AdminLTE 3 with user management, roles, permissions, ...

1647.7k](/packages/agungsugiarto-boilerplate)[agungsugiarto/codeigniter4-authentication

Provides an API for authentication and includes concrete authentication adapters for common use case scenarios

494.5k2](/packages/agungsugiarto-codeigniter4-authentication)[tatter/permits

Model permission handling for CodeIgniter 4

1443.0k2](/packages/tatter-permits)

PHPackages © 2026

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