PHPackages                             aladler/laravel-pennant-session-and-db-driver - 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. aladler/laravel-pennant-session-and-db-driver

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

aladler/laravel-pennant-session-and-db-driver
=============================================

A 'session &amp; DB driver' for Laravel Pennant for feature flags pre and post user authentication.

v0.1.3(2y ago)0889↓25%MITPHPPHP &gt;=8.2

Since Sep 29Pushed 2y agoCompare

[ Source](https://github.com/AlAdler/LaravelPennantSessionAndDBDriver)[ Packagist](https://packagist.org/packages/aladler/laravel-pennant-session-and-db-driver)[ Docs](https://github.com/AlAdler/LaravelPennantSessionAndDBDriver)[ RSS](/packages/aladler-laravel-pennant-session-and-db-driver/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (4)Dependencies (5)Versions (5)Used By (0)

[![Build Status](https://github.com/AlAdler/LaravelPennantSessionAndDBDriver/workflows/tests/badge.svg)](https://github.com/AlAdler/LaravelPennantSessionAndDBDriver/actions)[![Total Downloads](https://camo.githubusercontent.com/97916f7ee035a5cf50d07ad3be1b6179802dbea9407f02b930ae23651c5138d8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f416c41646c65722f4c61726176656c2d50656e6e616e742d53657373696f6e2d416e642d44422d447269766572)](https://packagist.org/packages/aladler/laravel-pennant-session-and-db-driver)[![Latest Stable Version](https://camo.githubusercontent.com/db8500bc84fbf32111b8acba0b2235ac776e7fce103dcc27606bc59b94ed0950/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f416c41646c65722f4c61726176656c2d50656e6e616e742d53657373696f6e2d416e642d44422d447269766572)](https://packagist.org/packages/aladler/laravel-pennant-session-and-db-driver)[![License](https://camo.githubusercontent.com/e3a988ee34e56d81609d7ac582195ec0c047d9bea044feb6d1359e7cca2b2672/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f416c41646c65722f4c61726176656c2d50656e6e616e742d53657373696f6e2d416e642d44422d447269766572)](https://packagist.org/packages/aladler/laravel-pennant-session-and-db-driver)

Introduction
------------

[](#introduction)

A 'session &amp; DB driver' for Laravel Pennant for feature flags pre- and post-user authentication.

Requirements
------------

[](#requirements)

- Laravel 10 or higher
- PHP 8.1 or higher
- [Pennant 1.6](https://laravel.com/docs/10.x/pennant) or higher

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

[](#installation)

You can install the package via composer:

```
composer require aladler/laravel-pennant-session-and-db-driver
```

Add the driver to your `config/pennant.php` file:

```
'stores' => [

    'session_and_database' => [
        'driver' => 'session_and_database',
        'table' => 'features',
    ],

],
```

Register the driver using Pennant's `extend` method (this can be done in the `AppServiceProvider`'s `boot` method)

```
public function boot(): void
{
    Feature::extend('session_and_database', function (){
        return new SessionAndDatabaseDriver(
            app()['db'],
            app()['events'],
            config(),
            [],
            app()['session']
        );
    });
}
```

If you wish this driver to be the default driver, change the `default` value in `config/pennant.php` to `session_and_database`.

```
'default' => env('PENNANT_STORE', 'session_and_database'),
```

or put it in your .env file

```
PENNANT_STORE=session_and_database

```

Your User model (or any other Authenticatable) must implement the `Aladler\LaravelPennantSessionAndDbDriver\Contracts\UserThatHasPreRegisterFeatures` interface.

```
class User extends Authenticable implements UserThatHasPreRegisterFeatures
```

Usage
-----

[](#usage)

You can activate features for guests and after authentication, the feature will be persisted in the database. Or if a feature is activated when a user is logged in, if they log out (or the session times out in the same device), the feature will still be active for them. This allows, for example, to a/b tests features on the registration flow and keep the same experience after registration is completed.

License
-------

[](#license)

This open-sourced software is licensed under the [MIT license](LICENSE.md).

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

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

Total

4

Last Release

838d ago

PHP version history (2 changes)v0.1.0PHP &gt;=8.1

v0.1.3PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/238d8389fe647137a440721ab44faf3d45508d6a57e8f6d0020068903cf96fe9?d=identicon)[AlAdler](/maintainers/AlAdler)

---

Top Contributors

[![AlAdler](https://avatars.githubusercontent.com/u/2527335?v=4)](https://github.com/AlAdler "AlAdler (8 commits)")

---

Tags

laravelflagsfeaturepennant

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/aladler-laravel-pennant-session-and-db-driver/health.svg)

```
[![Health](https://phpackages.com/badges/aladler-laravel-pennant-session-and-db-driver/health.svg)](https://phpackages.com/packages/aladler-laravel-pennant-session-and-db-driver)
```

###  Alternatives

[laravel/pennant

A simple, lightweight library for managing feature flags.

58414.2M98](/packages/laravel-pennant)[stephenjude/filament-feature-flags

Filament implementation of feature flags and segmentation with Laravel Pennant.

122177.8k1](/packages/stephenjude-filament-feature-flags)[codinglabsau/laravel-feature-flags

Dynamic feature flags for laravel.

3891.0k](/packages/codinglabsau-laravel-feature-flags)[martbock/laravel-diceware

Diceware Passphrase Generator for Laravel

3271.1k](/packages/martbock-laravel-diceware)[orchestra/auth

Auth Component for Orchestra Platform

23108.7k3](/packages/orchestra-auth)[ingria/laravel-x509-auth

Laravel 5 Client Certificate auth middleware

375.7k](/packages/ingria-laravel-x509-auth)

PHPackages © 2026

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