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(6y ago)011PHP

Since Jun 16Pushed 6y 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 today

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 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

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

Unknown

Total

1

Last Release

2208d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2303288?v=4)[Steve Edward](/maintainers/submtd)[@submtd](https://github.com/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

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.3M17](/packages/kartik-v-yii2-password)[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

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