PHPackages                             mocode/sanctum-mongodb - 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. mocode/sanctum-mongodb

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

mocode/sanctum-mongodb
======================

Laravel Sanctum Mongodb provides a featherweight authentication system for SPAs and simple APIs.

v2.10.0(5y ago)21.9k4MITPHPPHP ^7.2|^8.0

Since Apr 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/mooole/sanctum-mongodb)[ Packagist](https://packagist.org/packages/mocode/sanctum-mongodb)[ RSS](/packages/mocode-sanctum-mongodb/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

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

[](#introduction)

Laravel Sanctum MongoDB provides a featherweight authentication system for SPAs and simple APIs.

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

[](#installation)

You may install Laravel Sanctum MongoDB via the Composer package manager:

```
composer require mocode/sanctum-mongodb

```

Next, you should publish the Sanctum configuration and migration files using the `vendor:publish` Artisan command. The `sanctum` configuration file will be placed in your application's `config` directory:

```
php artisan vendor:publish --provider="Mocode\Sanctum\SanctumServiceProvider"

```

Finally, you should run your database migrations. Sanctum will create one database table in which to store API tokens:

```
php artisan migrate

```

Next, if you plan to utilize Sanctum to authenticate an SPA, you should add Sanctum's middleware to your `api` middleware group within your application's `app/Http/Kernel.php` file:

```
'api' => [
    \Mocode\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
    'throttle:api',
    \Illuminate\Routing\Middleware\SubstituteBindings::class,
],

```

Official Documentation
----------------------

[](#official-documentation)

Documentation for Sanctum can be found on the [Laravel website](https://laravel.com/docs/sanctum).

License
-------

[](#license)

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

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

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

Unknown

Total

1

Last Release

1842d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c7a2646e061881b5fd16b22f623bf0a9be52098364121748810d5d8e573fe2b?d=identicon)[mocode](/maintainers/mocode)

---

Top Contributors

[![mooole](https://avatars.githubusercontent.com/u/8140392?v=4)](https://github.com/mooole "mooole (1 commits)")

---

Tags

laravelauthsanctummongodb

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mocode-sanctum-mongodb/health.svg)

```
[![Health](https://phpackages.com/badges/mocode-sanctum-mongodb/health.svg)](https://phpackages.com/packages/mocode-sanctum-mongodb)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[watson/validating

Eloquent model validating trait.

9723.3M46](/packages/watson-validating)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[outerweb/settings

Application wide settings stored in your database

4899.2k5](/packages/outerweb-settings)

PHPackages © 2026

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