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

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

submtd/laravel-api-token
========================

API authentication with short lived tokens

1.0.0009(5y ago)011PHP

Since Jun 16Pushed 5y ago1 watchersCompare

[ Source](https://github.com/submtd/laravel-api-token)[ Packagist](https://packagist.org/packages/submtd/laravel-api-token)[ RSS](/packages/submtd-laravel-api-token/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Laravel Api Token
=================

[](#laravel-api-token)

This package allows you to use short lived API tokens to protect endpoints.

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

[](#installation)

First, pull the package in via composer.

```
composer require submtd/laravel-api-token

```

Second, run the database migrations.

```
php artisan migrate

```

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

[](#configuration)

This package reads values from the .env file in order to control the length of the tokens and the expiration time.

```
// .env
API_TOKEN_LENGTH=128
API_REFRESH_LENGTH=256
API_TOKEN_EXPIRATION_MINUTES=1440
API_REFRESH_EXPIRATION_MINUTES=10080
API_USER_MODEL=\App\User

```

Endpoints
---------

[](#endpoints)

This package provides several endpoints to manage api tokens.

### Public Endpoints

[](#public-endpoints)

**POST: /api/v1/token/login**

This endpoint accepts email and password and returns a new API token.

**POST: /api/v1/token/refresh**

This endpoints accepts a `refresh_token` parameter and returns a refreshed API token.

### Protected Endpoints

[](#protected-endpoints)

The following endpoints require a valid API token for access.

**GET: /api/v1/token**

This endpoint lists all user tokens.

**GET: /api/v1/token/{uuid}**

This endpoint shows a specific API token.

**DELETE: /api/v1/token/{uuid}**

This endpoint destroys a specific API token.

**POST: /api/v1/token/create**

This endpoint creates a new API token. An optional `name` parameter can be provided to name the token.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Unknown

Total

1

Last Release

2155d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f2ec485b862557409bdcfdc47aae18b204e6ee01395abb8113cb30c40c30e59?d=identicon)[submtd](/maintainers/submtd)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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