PHPackages                             element/sentinel - 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. element/sentinel

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

element/sentinel
================

Sentinel is a PHP 7.4+ framework agnostic fully-featured authentication &amp; authorization system. It also provides additional features such as user roles and additional security features.

3.0.3(3mo ago)13MITPHPPHP &gt;=7.2

Since Feb 20Pushed 3mo agoCompare

[ Source](https://github.com/tiny-rebels/element-sentinel)[ Packagist](https://packagist.org/packages/element/sentinel)[ RSS](/packages/element-sentinel/feed)WikiDiscussions development Synced today

READMEChangelog (5)Dependencies (9)Versions (7)Used By (0)

Element Sentinel
================

[](#element-sentinel)

A framework‑agnostic authentication &amp; activation library for PHP 7+

[![Packagist Version](https://camo.githubusercontent.com/6b69746fa14f675e8b46af03cc3b6cd917aaacbb54d9ca08dd8a8c7ba7b73476/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656c656d656e742f73656e74696e656c3f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/6b69746fa14f675e8b46af03cc3b6cd917aaacbb54d9ca08dd8a8c7ba7b73476/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656c656d656e742f73656e74696e656c3f7374796c653d666c61742d737175617265)[![Total Downloads](https://camo.githubusercontent.com/f70716316473403b41d56a31b1cd7769d1afa20dd820ff4abc89e2e8f0d0d52a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656c656d656e742f73656e74696e656c3f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/f70716316473403b41d56a31b1cd7769d1afa20dd820ff4abc89e2e8f0d0d52a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656c656d656e742f73656e74696e656c3f7374796c653d666c61742d737175617265)[![PHP Version](https://camo.githubusercontent.com/357e1babfe350fda4c3d01a22f7a005cfe6baa40fac1d0111b3142fcba2e5ba2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f656c656d656e742f73656e74696e656c3f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/357e1babfe350fda4c3d01a22f7a005cfe6baa40fac1d0111b3142fcba2e5ba2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f656c656d656e742f73656e74696e656c3f7374796c653d666c61742d737175617265)[![License](https://camo.githubusercontent.com/2259542a5a656af035d9df6956342fd41eabe92b29c4fa68624496b9dc070d55/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f656c656d656e74337068702f73656e74696e656c3f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/2259542a5a656af035d9df6956342fd41eabe92b29c4fa68624496b9dc070d55/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f656c656d656e74337068702f73656e74696e656c3f7374796c653d666c61742d737175617265)

Element Sentinel is a simple, stable and flexible authentication component designed to work in **any PHP 7.x project** — including custom frameworks such as *Element3*.

The library provides:

- User activation through activation codes
- Repository implementations for **PDO** and **Eloquent**
- A clean and minimal **Sentinel core** for activation, hashing, and storage
- Plain SQL migration files (no dependency on Laravel migrations)
- A fully framework‑agnostic architecture (no routing, middleware, etc.)

The goal is to deliver a **minimalistic** yet **robust** authentication component that is easy to integrate without forcing any particular structure or framework.

---

🚀 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require element/sentinel
```

🧩 Instantiating Sentinel
------------------------

[](#-instantiating-sentinel)

Element Sentinel is instantiated through a fluent builder, allowing you to plug in your preferred storage layer (PDO or Eloquent) as well as the password hasher. This makes Sentinel fully flexible and framework‑agnostic. Below are two recommended setups.

### 🔌 Using PDO

[](#-using-pdo)

```
use PDO;
use Element\Sentinel\SentinelBuilder;
use Element\Sentinel\Support\NativePasswordHasher;
use Element\Sentinel\Infrastructure\PDO\PdoUserRepository;
use Element\Sentinel\Infrastructure\PDO\PdoActivationRepository;

$pdoConnection = new PDO(
    'mysql:host=localhost;dbname=myapp;charset=utf8mb4',
    'username',
    'password',
    [
        PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
    ]
);

$sentinel = Builder::create()
    ->withUserRepository(new PdoUserRepository($pdoConnection))
    ->withActivationRepository(new PdoActivationRepository($pdoConnection))
    ->withPasswordHasher(new NativePasswordHasher())
    ->build();
```

or by

### 🏗 Using Eloquent (Capsule)

[](#-using-eloquent-capsule)

```
use Illuminate\Database\Capsule\Manager as Capsule;
use Element\Sentinel\SentinelBuilder;
use Element\Sentinel\Support\NativePasswordHasher;
use Element\Sentinel\Infrastructure\Eloquent\EloquentUserRepository;
use Element\Sentinel\Infrastructure\Eloquent\EloquentActivationRepository;

$capsule = new Capsule();
$capsule->addConnection([
    'driver'    => 'mysql',
    'host'      => 'localhost',
    'schemas'  => 'myapp',
    'username'  => 'username',
    'password'  => 'password',
]);

$capsule->setAsGlobal();
$capsule->bootEloquent();

$sentinel = Builder::create()
    ->withUserRepository(new EloquentUserRepository())
    ->withActivationRepository(new EloquentActivationRepository())
    ->withPasswordHasher(new NativePasswordHasher())
    ->build();
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance79

Regular maintenance activity

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

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

Total

5

Last Release

110d ago

Major Versions

1.0.1 → 3.0.12026-03-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/768b11461d6a9d2b24d70209887318b78f0a4864a9ed372a24e0b859c7431ac0?d=identicon)[Stjo](/maintainers/Stjo)

---

Top Contributors

[![skf83](https://avatars.githubusercontent.com/u/9106072?v=4)](https://github.com/skf83 "skf83 (10 commits)")

---

Tags

notificationsslacksmsmessagesElement core

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/element-sentinel/health.svg)

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

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[illuminate/log

The Illuminate Log package.

6225.3M621](/packages/illuminate-log)[laravel/nightwatch

The official Laravel Nightwatch package.

36210.1M36](/packages/laravel-nightwatch)

PHPackages © 2026

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