PHPackages                             skulich/laravel-clavis - 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. skulich/laravel-clavis

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

skulich/laravel-clavis
======================

Laravel Clavis is a lightweight token-based authentication middleware package for Laravel APIs

1.0.0(4mo ago)0198MITPHPPHP ^8.3CI passing

Since Jan 2Pushed 4mo agoCompare

[ Source](https://github.com/skulich/laravel-clavis)[ Packagist](https://packagist.org/packages/skulich/laravel-clavis)[ RSS](/packages/skulich-laravel-clavis/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (10)Versions (2)Used By (0)

Laravel Clavis
==============

[](#laravel-clavis)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f7576e14b663217aeccee34231fcd7092c0a5a508e40db94c0ec103d53946655/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736b756c6963682f6c61726176656c2d636c617669732e737667)](https://packagist.org/packages/skulich/laravel-clavis)[![PHP Version Require](https://camo.githubusercontent.com/2209605b7f7ba8e4fff2f931e5f48cc0dff5e75590987452786917ef9bb16098/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736b756c6963682f6c61726176656c2d636c61766973)](https://camo.githubusercontent.com/2209605b7f7ba8e4fff2f931e5f48cc0dff5e75590987452786917ef9bb16098/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736b756c6963682f6c61726176656c2d636c61766973)[![Laravel Version](https://camo.githubusercontent.com/06b665553c47eeccb1b78de1027bca7a2f0cf5f8d13226bd3eb8d30c3a19c628/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d25354531322e302532302d7265643f6c6f676f3d6c61726176656c)](https://camo.githubusercontent.com/06b665553c47eeccb1b78de1027bca7a2f0cf5f8d13226bd3eb8d30c3a19c628/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d25354531322e302532302d7265643f6c6f676f3d6c61726176656c)[![Run Tests](https://github.com/skulich/laravel-clavis/actions/workflows/tests.yml/badge.svg)](https://github.com/skulich/laravel-clavis/actions)[![Code Coverage](https://camo.githubusercontent.com/32855e94577df9d0a30995653b17d33a5fbfdf644518f96ea0374313397d19b7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d3130302532352d627269676874677265656e)](https://camo.githubusercontent.com/32855e94577df9d0a30995653b17d33a5fbfdf644518f96ea0374313397d19b7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d3130302532352d627269676874677265656e)[![License](https://camo.githubusercontent.com/6419956665cf8bb8f34605e6c16340609710475747a7a2e8a9db251ffdcca3c9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f736b756c6963682f6c61726176656c2d636c617669732e737667)](https://camo.githubusercontent.com/6419956665cf8bb8f34605e6c16340609710475747a7a2e8a9db251ffdcca3c9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f736b756c6963682f6c61726176656c2d636c617669732e737667)[![Total Downloads](https://camo.githubusercontent.com/8798f3bdf6884affe3c015083fb3b8bd9ccbdbe2997bcf680eedc35dc64df68e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736b756c6963682f6c61726176656c2d636c617669732e737667)](https://camo.githubusercontent.com/8798f3bdf6884affe3c015083fb3b8bd9ccbdbe2997bcf680eedc35dc64df68e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736b756c6963682f6c61726176656c2d636c617669732e737667)

**Laravel Clavis** is a lightweight token-based authentication middleware package for Laravel APIs.

Perfect for **API-first applications** and **microservices** where you need simple and secure token-based authentication without the overhead of Sanctum.

**Key benefits:**

- 🚀 **Quick Setup**: Create a token via CLI
- 🔒 **Secure**: Built on Laravel's native Hash generator
- 🎯 **Focused**: Designed for server-to-server scenarios
- 🧹 **Clean**: No migrations, No users, No dependencies

Table of contents
=================

[](#table-of-contents)

- [Installation](#installation)
- [Usage](#usage)
    - [CLI Command](#cli-command)
    - [API Middleware](#api-middleware)
- [Tests](#tests)
- [Changelog](#changelog)
- [Contributing](#contributing)
- [License](#license)

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

[](#installation)

Install the package via Composer.

```
composer require skulich/laravel-clavis
```

Usage
-----

[](#usage)

CLI Command
-----------

[](#cli-command)

Create a new API token via CLI.

```
php artisan clavis:token
```

API Middleware
--------------

[](#api-middleware)

Add the `clavis` middleware to your API routes.

```
// Per Route
Route::get('/test', function (Request $request) {
    // return ...
})->middleware('clavis');

// Per Group
Route::middleware('clavis')->group(function () {
    // Route:: ...
});

// Globally in app/bootstrap/app.php
->withMiddleware(function (Middleware $middleware): void {
    $middleware->appendToGroup('api', 'clavis');
})
```

Tests
-----

[](#tests)

Run the entire test suite:

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for more information.

License
-------

[](#license)

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

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance77

Regular maintenance activity

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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

130d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/19b0704d357e2e3bcbdbfd53e191d96eb4e0417e9b13e4a56f6f8367153eab32?d=identicon)[skulich](/maintainers/skulich)

---

Top Contributors

[![skulich](https://avatars.githubusercontent.com/u/170199581?v=4)](https://github.com/skulich "skulich (17 commits)")

---

Tags

middlewareapilaravelauthtoken

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/skulich-laravel-clavis/health.svg)

```
[![Health](https://phpackages.com/badges/skulich-laravel-clavis/health.svg)](https://phpackages.com/packages/skulich-laravel-clavis)
```

###  Alternatives

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)[erjanmx/laravel-api-auth

Dead simple Laravel api authorization middleware

2024.5k](/packages/erjanmx-laravel-api-auth)

PHPackages © 2026

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