PHPackages                             cline/bearer - 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. cline/bearer

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

cline/bearer
============

Stripe-style typed API tokens with groups, environments, and audit logging for Laravel

5.2.0(1mo ago)01.6k↓35.2%MITPHPPHP ^8.5.0CI passing

Since Dec 30Pushed 1mo agoCompare

[ Source](https://github.com/faustbrian/bearer)[ Packagist](https://packagist.org/packages/cline/bearer)[ RSS](/packages/cline-bearer/feed)WikiDiscussions 5.x Synced 1mo ago

READMEChangelog (10)Dependencies (27)Versions (24)Used By (0)

[![GitHub Workflow Status](https://github.com/faustbrian/bearer/actions/workflows/quality-assurance.yaml/badge.svg)](https://github.com/faustbrian/bearer/actions)[![Latest Version on Packagist](https://camo.githubusercontent.com/922f31f7f3acc4285f658c9fa3dd5d265acc5e92e63420971ba108772ea5f83f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c696e652f6265617265722e737667)](https://packagist.org/packages/cline/bearer)[![Software License](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/7da40776bbbec3498bfb3bb2638a2f412404dcdac36333dea4e75ddc078d75f2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c696e652f6265617265722e737667)](https://packagist.org/packages/cline/bearer)

---

Stripe-style typed API tokens with groups, environments, and audit logging for Laravel. Features conductor-based API, token rotation, revocation strategies, seamless Sanctum integration, and optional recoverable legacy tokens for systems that must display keys after creation.

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

[](#requirements)

> **Requires [PHP 8.4+](https://php.net/releases/)** and Laravel 11+

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

[](#installation)

```
composer require cline/bearer
```

If you want Bearer to delegate runtime ability checks to Warden, install Warden in your application and switch the authorization driver:

```
composer require cline/warden
```

```
// config/bearer.php
'authorization' => [
    'default' => env('BEARER_AUTHORIZATION_DRIVER', 'array'),
],
```

`array` remains the default provider. `warden` requires both the token's stored ability scope and the token owner's Warden permission to pass.

Bearer also honors the configured morph key map when hydrating token ownership relations. If your `User`, `Organization`, or other owner model uses `ulid` or `uuid` as its primary key, configure the relevant entry in `morphKeyMap` or `enforceMorphKeyMap` and Bearer will resolve `owner`, `context`, and `boundary` correctly.

Documentation
-------------

[](#documentation)

- **[Getting Started](DOCS.md#doc-docs-readme)** - Installation, configuration, and first steps
- **[Basic Usage](DOCS.md#doc-docs-basic-usage)** - Creating, validating, and managing tokens
- **[Authentication](DOCS.md#doc-docs-authentication)** - Integrating with Laravel authentication
- **[Custom Token Types](DOCS.md#doc-docs-custom-token-types)** - Defining typed tokens with abilities
- **[Token Metadata](DOCS.md#doc-docs-token-metadata)** - Attaching and querying token metadata
- **[Derived Keys](DOCS.md#doc-docs-derived-keys)** - Hierarchical token derivation for resellers
- **[Revocation &amp; Rotation](DOCS.md#doc-docs-revocation-rotation)** - Token lifecycle management
- **[IP &amp; Domain Restrictions](DOCS.md#doc-docs-ip-domain-restrictions)** - Network-based access control
- **[Rate Limiting](DOCS.md#doc-docs-rate-limiting)** - Throttling token usage
- **[Usage Tracking](DOCS.md#doc-docs-usage-tracking)** - Monitoring token activity
- **[Audit Logging](DOCS.md#doc-docs-audit-logging)** - Recording token events
- **[Token Generators](DOCS.md#doc-docs-token-generators)** - Custom token generation strategies

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please use the [GitHub security reporting form](https://github.com/faustbrian/bearer/security) rather than the issue queue.

Credits
-------

[](#credits)

- [Brian Faust](https://github.com/faustbrian)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License. Please see [License File](LICENSE.md) for more information.

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance90

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Total

23

Last Release

52d ago

Major Versions

1.1.0 → 2.0.02025-11-29

2.3.0 → 3.0.02025-12-01

3.x-dev → 4.0.02026-03-04

4.x-dev → 5.0.02026-03-21

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22145591?v=4)[Brian Faust](/maintainers/faustbrian)[@faustbrian](https://github.com/faustbrian)

---

Top Contributors

[![faustbrian](https://avatars.githubusercontent.com/u/22145591?v=4)](https://github.com/faustbrian "faustbrian (21 commits)")

---

Tags

phplaravelAuthenticationsanctumapi-tokens

### Embed Badge

![Health badge](/badges/cline-bearer/health.svg)

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

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M350](/packages/tymon-jwt-auth)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M53](/packages/php-open-source-saver-jwt-auth)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laragear/two-factor

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

339785.3k8](/packages/laragear-two-factor)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)

PHPackages © 2026

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