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 3w ago

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 4% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity33

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

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198741.5k12](/packages/pgvector-pgvector)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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