PHPackages                             boone-studios/laravel-api-keys - 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. boone-studios/laravel-api-keys

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

boone-studios/laravel-api-keys
==============================

Prefixed, hashed API keys with scope-to-permission mapping for multi-tenant Laravel APIs.

v0.1.1(1mo ago)050↓75%MITPHPPHP ^8.2

Since Jul 11Pushed 1mo agoCompare

[ Source](https://github.com/boone-studios/laravel-api-keys)[ Packagist](https://packagist.org/packages/boone-studios/laravel-api-keys)[ RSS](/packages/boone-studios-laravel-api-keys/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (7)Versions (3)Used By (0)

boone-studios/laravel-api-keys
==============================

[](#boone-studioslaravel-api-keys)

[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![Used by Forgebit](https://camo.githubusercontent.com/187290bd460f372218fece58ee3e7bbb592808bc411bd6a4aa22170503c5a496/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7573656425323062792d466f7267656269742d616d626572)](https://forgebit.io)

Prefixed, hashed API keys with scope-to-permission mapping for multi-tenant Laravel APIs. Pairs naturally with [`boone-studios/laravel-scoped-roles`](https://github.com/boone-studios/laravel-scoped-roles) via `TokenPermissionResolver`.

Features
--------

[](#features)

- Brand-prefixed secrets (`app_live_…`) with masked display prefixes
- Hashed storage with prefix lookup + `Hash::check`
- Revocation and expiration support
- Scope → permission bridge for unified API + dashboard authorization
- Configurable tenant guard hook (e.g. block deleted organizations)

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

[](#requirements)

- PHP 8.2+
- Laravel 12 or 13
- `boone-studios/laravel-scoped-roles` (for token permission integration)

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

[](#installation)

```
composer require boone-studios/laravel-scoped-roles boone-studios/laravel-api-keys
```

```
php artisan vendor:publish --tag=api-keys-config
php artisan vendor:publish --tag=api-keys-migrations
php artisan migrate
```

Quick start
-----------

[](#quick-start)

1. Implement `ResolvesScopePermissions` on your scope enum (maps `read`/`write`/`admin` → permission strings).
2. Implement `ResolvesEnvironmentFromTokenPrefix` if you support multiple environments.
3. Optionally implement `GuardsAuthenticatedTenant` for tenant availability checks.
4. Extend `BooneStudios\ApiKeys\Models\ApiKey` and add your tenant relation.
5. Register middleware: `auth.api_key`.

License
-------

[](#license)

MIT © Boone Studios, LLC

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

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

Total

2

Last Release

50d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/76f1c4c8777cc7686e9ccd81c8f8deed5c4f443d7ca85cb4b78984acba7dd31c?d=identicon)[boonestudios](/maintainers/boonestudios)

---

Top Contributors

[![leemcd56](https://avatars.githubusercontent.com/u/1885663?v=4)](https://github.com/leemcd56 "leemcd56 (5 commits)")

---

Tags

laravelAuthenticationscopesmulti-tenantapi keys

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/boone-studios-laravel-api-keys/health.svg)

```
[![Health](https://phpackages.com/badges/boone-studios-laravel-api-keys/health.svg)](https://phpackages.com/packages/boone-studios-laravel-api-keys)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3365.5M359](/packages/psalm-plugin-laravel)[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k59.5M713](/packages/laravel-scout)[api-platform/laravel

API Platform support for Laravel

58190.1k22](/packages/api-platform-laravel)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45945.2k1](/packages/pressbooks-pressbooks)[forjedio/inertia-table

Backend-driven dynamic tables for Laravel + Inertia.js

272.5k](/packages/forjedio-inertia-table)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2116.7k](/packages/alajusticia-laravel-logins)

PHPackages © 2026

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