cline/bearer

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

Maintainers

Package info

github.com/faustbrian/bearer

pkg:composer/cline/bearer

Statistics

Installs: 1 648

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

5.2.0 2026-03-28 02:41 UTC

This package is auto-updated.

Last update: 2026-03-28 02:42:33 UTC


README

GitHub Workflow Status Latest Version on Packagist Software License Total Downloads

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

Requires PHP 8.4+ and Laravel 11+

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

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please use the GitHub security reporting form rather than the issue queue.

Credits

License

The MIT License. Please see License File for more information.