PHPackages                             mariojgt/masterkey - 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. mariojgt/masterkey

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

mariojgt/masterkey
==================

MasterKey - Minimal QR-based auth for Laravel + Ionic (no Sanctum).

v1.0.3(9mo ago)279↓93.3%1MITPHPPHP ^8.3CI passing

Since Sep 17Pushed 9mo agoCompare

[ Source](https://github.com/mariojgt/masterkey)[ Packagist](https://packagist.org/packages/mariojgt/masterkey)[ RSS](/packages/mariojgt-masterkey/feed)WikiDiscussions main Synced today

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

MasterKey (Laravel package)
===========================

[](#masterkey-laravel-package)

QR-based login bridge between your Laravel app and the MasterKey mobile app (Ionic). **No Sanctum.** Minimal and production-ready.

Highlights
----------

[](#highlights)

- Permanent or expiring API tokens (config).
- Pre-login QR → 6-digit code → app token.
- Web/admin login via QR scanned by authenticated app.
- Logout QR triggers event/callback for your custom logic.
- Tiny `auth.token` middleware for Bearer tokens.

Install
-------

[](#install)

```
composer require mariojgt/masterkey:*
php artisan vendor:publish --provider="Mariojgt\MasterKey\MasterKeyServiceProvider" --tag=config
php artisan migrate
```

Add a path repo if using from source:

```
"repositories": [{ "type": "path", "url": "packages/masterkey" }]
```

Config (`config/masterkey.php`)
-------------------------------

[](#config-configmasterkeyphp)

- `token_expires_days` → null = never expire (default).
- `post_login_redirect` → where browser goes after QR approval.
- `logout_callback_route` → optional HTTP callback you implement.
- `qr_prefix` → default `mkey:`.

Routes
------

[](#routes)

- Public:
    - `GET /login-qr` → Blade page that displays QR and polls status.
    - `GET /api/web/status?session_id=` → polled by the page.
    - `POST /api/app/request-code` `{email}` → returns `{nonce, code, qr_payload}` (demo returns code).
    - `POST /api/app/verify` `{nonce, code}` → returns `{token, user}`.
- Authenticated (with Bearer token via app):
    - `POST /api/web/approve` `{session_id}` → approves web login.
    - `POST /api/logout-qr` → fires event for your logout logic.

Protect API
-----------

[](#protect-api)

```
Route::middleware(\Mariojgt\MasterKey\Http\Middleware\AuthToken::class)
     ->get('/api/me', fn() => auth()->user());
```

Client app
----------

[](#client-app)

You can download here [MasterKey app](https://github.com/mariojgt/masterkey-app).

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance57

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Total

4

Last Release

283d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c75bb50805eab19dd419d846ba0a7178adac9b475f9787fc213d8be1262ece3c?d=identicon)[mariojgt](/maintainers/mariojgt)

---

Top Contributors

[![mariojgt](https://avatars.githubusercontent.com/u/7347012?v=4)](https://github.com/mariojgt "mariojgt (11 commits)")

### Embed Badge

![Health badge](/badges/mariojgt-masterkey/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[statamic/cms

The Statamic CMS Core Package

4.8k3.6M985](/packages/statamic-cms)[jeffgreco13/filament-breezy

A custom package for Filament with login flow, profile and teams support.

1.0k2.1M57](/packages/jeffgreco13-filament-breezy)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

84215.9k9](/packages/stephenjude-filament-two-factor-authentication)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[laragear/two-factor

On-premises 2FA Authentication for out-of-the-box.

341942.8k18](/packages/laragear-two-factor)

PHPackages © 2026

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