PHPackages                             vdhoangson/laravel-api-auth - 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. vdhoangson/laravel-api-auth

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

vdhoangson/laravel-api-auth
===========================

Laravel Api Authentication

v1.0(11mo ago)122PHPPHP ^8.2

Since Jun 5Pushed 11mo agoCompare

[ Source](https://github.com/vdhoangson/laravel-api-auth)[ Packagist](https://packagist.org/packages/vdhoangson/laravel-api-auth)[ GitHub Sponsors](https://github.com/vdhoangson)[ RSS](/packages/vdhoangson-laravel-api-auth/feed)WikiDiscussions main Synced 1mo ago

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

Laravel API Auth
================

[](#laravel-api-auth)

A simple Laravel package for API authentication using custom client credentials via headers.

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

[](#installation)

1. **Install the package**

```
composer require vdhoangson/laravel-api-auth
```

2. **Register the Service Provider** (if not auto-discovered)

Add to `bootstrap/providers.php`:

*(This package autoload provider)*

```
Vdhoangson\LaravelApiAuth\LaravelApiAuthServiceProvider::class,
```

3. **Publish config and run migrations**

```
php artisan vendor:publish --tag=laravel-api-auth-config
php artisan migrate
```

4. **Add data to the `api_clients` table**

Create a record with the fields: `name`, `client`, `client_secret`.

5. **Use the middleware in your routes**

```
Route::middleware('client-auth')->get('/test', function () {
    return response()->json(['message' => 'Authenticated!']);
});
```

6. **Send a test request**

Send a request with the following headers:

- `X-Client`
- `X-Client-Secret`

Example:

```
curl -H "X-Client: your_client" -H "X-Client-Secret: your_secret" http://your-app.local/api/test
```

Funding
-------

[](#funding)

If you find this package helpful, you can support the author via GitHub Sponsors:

[github.com/sponsors/vdhoangson](https://github.com/sponsors/vdhoangson)

License
-------

[](#license)

MIT

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance52

Moderate activity, may be stable

Popularity9

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

340d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f829efb802719122e2b5405a6e123b3f425c87b840c211b7361048c5caa1bce4?d=identicon)[vdhoangson](/maintainers/vdhoangson)

---

Top Contributors

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

---

Tags

laravellaravel-package

### Embed Badge

![Health badge](/badges/vdhoangson-laravel-api-auth/health.svg)

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

###  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)[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.2M119](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

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

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)

PHPackages © 2026

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