PHPackages                             luewell/laravel-mongodb-session - 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. [Database &amp; ORM](/categories/database)
4. /
5. luewell/laravel-mongodb-session

ActiveLibrary[Database &amp; ORM](/categories/database)

luewell/laravel-mongodb-session
===============================

A mongodb session driver for laravel

01PHP

Since Aug 23Pushed 5y agoCompare

[ Source](https://github.com/luewell/laravel-mongodb-session)[ Packagist](https://packagist.org/packages/luewell/laravel-mongodb-session)[ RSS](/packages/luewell-laravel-mongodb-session/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Mongodb Session driver
==============================

[](#laravel-mongodb-session-driver)

A MongoDB session driver for Laravel

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

[](#installation)

Install using composer:

```
composer require 1ff/laravel-mongodb-session

```

Change the connection in `config/session.php` to the name of the mongo connection from your `config/database.php` config

```
'connection' =>  'mongodb',

```

Update your .env file and change the `SESSION_DRIVER` to mongodb

```
SESSION_DRIVER=mongodb

```

Advantages
----------

[](#advantages)

- This driver uses the [MongoDB TTL indexes](https://docs.mongodb.com/manual/core/index-ttl/) meaning when a session key expires it will be automatically deleted. So no need for garbage collection implementation.
- This way, the collection's size will remain around the size you expect and won't get falsely filled with unused data.
- The package automatically adds a migration which creates the index. If you change the name of the `session.table` you should rerun the ttl index creation command `php artisan mongodb:session:index`.

Enjoy!
------

[](#enjoy)

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 91.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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/49596554?v=4)[Luewell](/maintainers/luewell)[@luewell](https://github.com/luewell)

---

Top Contributors

[![t1sh0o](https://avatars.githubusercontent.com/u/3911728?v=4)](https://github.com/t1sh0o "t1sh0o (11 commits)")[![isluewell](https://avatars.githubusercontent.com/u/49596542?v=4)](https://github.com/isluewell "isluewell (1 commits)")

### Embed Badge

![Health badge](/badges/luewell-laravel-mongodb-session/health.svg)

```
[![Health](https://phpackages.com/badges/luewell-laravel-mongodb-session/health.svg)](https://phpackages.com/packages/luewell-laravel-mongodb-session)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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