PHPackages                             naviisml/laravel-api-guard - 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. naviisml/laravel-api-guard

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

naviisml/laravel-api-guard
==========================

A API guard for Laravel.

1.0.0(5mo ago)067MITPHP

Since Jan 21Pushed 5mo agoCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Laravel API Guard
=================

[](#laravel-api-guard)

A lightweight Laravel package to authenticate requests using API keys via a custom guard.

Features
--------

[](#features)

- Auth guard: `auth:apikey`
- Secure access with public/private key headers
- Artisan command to generate keys

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

[](#installation)

1. Install the package (`composer require naviisml/laravel-api-guard`)
2. Publish the configuration\* (`php artisan api-guard:install`)

*\*This step is optional.*

3. A auth guard will automatically be added if it doesn't exist in the `config/auth.php` configuration.

```
'guards' => [
    'apikey' => [
        'driver' => 'apikey',
        'provider' => 'users', // Optional
    ],
],
```

Usage
-----

[](#usage)

### Authentication Guard

[](#authentication-guard)

Use `auth:apikey` on API routes:

```
Route::middleware('auth:apikey')->group(function () {
    Route::get('/secure-endpoint', fn() => 'Access granted');
});
```

### Required Headers

[](#required-headers)

HeaderDescription`X-Public-Key`Public API key`X-Private-Key`Private API key### Generate Keys

[](#generate-keys)

Run the artisan command:

```
php artisan make:api-keys
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance71

Regular maintenance activity

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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

165d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/43450192?v=4)[Navi](/maintainers/naviisml)[@naviisml](https://github.com/naviisml)

---

Top Contributors

[![naviisml](https://avatars.githubusercontent.com/u/43450192?v=4)](https://github.com/naviisml "naviisml (1 commits)")

### Embed Badge

![Health badge](/badges/naviisml-laravel-api-guard/health.svg)

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

###  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)
