PHPackages                             silverbullet/api-token-laravel - 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. silverbullet/api-token-laravel

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

silverbullet/api-token-laravel
==============================

Token-based API service authentication &amp; authorization for Laravel

1.1(5y ago)041MITPHPPHP ^7.0

Since Feb 6Pushed 5y ago1 watchersCompare

[ Source](https://github.com/yoksanherlie/api-token-laravel)[ Packagist](https://packagist.org/packages/silverbullet/api-token-laravel)[ Docs](https://github.com/yoksanherlie/api-token-laravel)[ RSS](/packages/silverbullet-api-token-laravel/feed)WikiDiscussions master Synced today

READMEChangelog (10)DependenciesVersions (14)Used By (0)

API Token Laravel
=================

[](#api-token-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5ca50a909a232ee57ffcdf0d149f9698c796da9f1d4a700ff482ad410865cfb3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696c76657262756c6c65742f6170692d746f6b656e2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/silverbullet/api-token-laravel)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/e56c1a44f36079706a8512d0675035d02bdbfcecde31bb88f0426131e684f6d5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73696c76657262756c6c65742f6170692d746f6b656e2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/silverbullet/api-token-laravel)

Setup
=====

[](#setup)

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

[](#installation)

```
$ composer require silverbullet/api-token-laravel
```

Configuration
-------------

[](#configuration)

Add service provider to the `providers` array in `config/app.php` file:

```
'providers' => [
    ...
    Silverbullet\ApiTokenLaravel\Providers\ApiTokenServiceProvider::class
],
```

Publish the migration file:

```
php artisan vendor:publish --provider="Silverbullet\ApiTokenLaravel\Providers\ApiTokenServiceProvider"
```

Run the migration:

```
php artisan migrate
```

Usage
=====

[](#usage)

API Token Commands
------------------

[](#api-token-commands)

### Generate new API Token

[](#generate-new-api-token)

```
$ php artisan api-token:generate {name} {code?}
```

### List all API Token

[](#list-all-api-token)

```
$ php artisan api-token:list
```

### Delete API Token by id

[](#delete-api-token-by-id)

```
$ php artisan api-token:delete {id}
```

Middleware
----------

[](#middleware)

Use middleware with the key `apitoken.auth:{code}` on your Larave route. Example:

```
Route::get('partner-products', function() {
    //
})->middleware('apitoken.auth:{service1}');
```

You can also pass multiple parameters for the `{code}` (e.g. `apitoken.auth{service1,service2}`). This feature enables you to authorize the service that is going to use your API.

### Authorize Request

[](#authorize-request)

To pass the middleware, you must include `Authorization` header as a part of your request.

```
Authorization: Basic {api_token_goes_here}

```

### Response

[](#response)

- `401`: Unauthenticated

    This error code means you do not have the valid token.
- `403`: Unauthorized

    This error code means you do have a valid token but not the permission to access the API you are trying to access.

License
=======

[](#license)

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

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

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

Every ~0 days

Total

13

Last Release

1970d ago

PHP version history (2 changes)1.0.0PHP ^7.0

1.0.4PHP ^7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20045308?v=4)[Yoksan Herlie](/maintainers/yoksanherlie)[@yoksanherlie](https://github.com/yoksanherlie)

---

Top Contributors

[![yoksanherlie](https://avatars.githubusercontent.com/u/20045308?v=4)](https://github.com/yoksanherlie "yoksanherlie (9 commits)")

---

Tags

apiapitokensauthenticationauthorizationlaravelphpapilaravelAuthenticationserviceauthorizationapi-token

### Embed Badge

![Health badge](/badges/silverbullet-api-token-laravel/health.svg)

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

###  Alternatives

[auth0/login

Auth0 Laravel SDK. Straight-forward and tested methods for implementing authentication, and accessing Auth0's Management API endpoints.

2795.3M3](/packages/auth0-login)[ejarnutowski/laravel-api-key

Authorize requests to your Laravel application with API keys

157465.5k1](/packages/ejarnutowski-laravel-api-key)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6804.7k6](/packages/hasinhayder-tyro)[pktharindu/nova-permissions

Laravel Nova Grouped Permissions (ACL)

136421.9k](/packages/pktharindu-nova-permissions)

PHPackages © 2026

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