PHPackages                             azzarip/api-basic-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. azzarip/api-basic-auth

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

azzarip/api-basic-auth
======================

Basic auth system for intraserver api communication

1.1.1(9mo ago)0141[4 PRs](https://github.com/azzarip/api-basic-auth/pulls)MITPHPPHP ^8.3CI passing

Since Aug 5Pushed 2mo agoCompare

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

READMEChangelog (3)Dependencies (13)Versions (8)Used By (0)

Basic auth system for intraserver api communication
===================================================

[](#basic-auth-system-for-intraserver-api-communication)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a46689f36fbc1844b289dd3e9dc782d9cb651ef7b1dd253a7905adf3634613d3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617a7a617269702f6170692d62617369632d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/azzarip/api-basic-auth)[![GitHub Tests Action Status](https://camo.githubusercontent.com/d06d06fbeb841ea984fd0059197c0d5d42b01d7a9fd4ee0b43c8bc151caf05e7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f617a7a617269702f6170692d62617369632d617574682f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/azzarip/api-basic-auth/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/70d13eba346f55a86d048223f797d4cd6613ad65f430bc7dd0ddd61eec8741e0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f617a7a617269702f6170692d62617369632d617574682f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/azzarip/api-basic-auth/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/6c61b3dfb83b03a339702ac138b590217bb359574bfb314589d640463f4b542e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617a7a617269702f6170692d62617369632d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/azzarip/api-basic-auth)

This package enables secure API communication between two Laravel applications using HTTP Basic Authentication.

Install the package on **both applications** that need to communicate.

In your `.env` or `config/services.php`, define the following:

- **Inbound Password**
    Used to authenticate **incoming** API requests from the other server.
- **Outbound Password**
    Used when this application sends **outgoing** API requests to the other server.
- **Endpoint**
    The full URL of the other server (e.g., `https://api.example.com`).

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

[](#installation)

You can install the package via composer:

```
composer require azzarip/api-basic-auth
```

In the `config/services.php` add the following

```
'username' => [
    'endpoint' => 'http....' //full url for calls
    'inbound_password' => env('INBOUND_PASSWORD'),
    'outbound_password' => env('OUTBOUND_PASSWORD'),
]
```

You can define multiple `username` each of them with endpoint and inbound and outbound password.

Usage
-----

[](#usage)

### Inbound Requests

[](#inbound-requests)

For the inbound request use the `api.auth` middleware, followed by the username as specified in the config file.

```
Route::get('/api')->middleware('api.auth:username');
```

This middleware will let all the request with username `username` and password `inbound_password`, as specified in the config files.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Azzarip](https://github.com/Azzarip)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance74

Regular maintenance activity

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.2% 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

Every ~0 days

Total

3

Last Release

286d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/552b5aa7ab775f5b73ebfd340bfbf922af893a120a4a97dc5abdf0ac7b116840?d=identicon)[azzarip](/maintainers/azzarip)

---

Top Contributors

[![azzarip](https://avatars.githubusercontent.com/u/116155557?v=4)](https://github.com/azzarip "azzarip (16 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelazzaripapi-basic-auth

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/azzarip-api-basic-auth/health.svg)

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

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k89.8M1.0k](/packages/spatie-laravel-permission)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[jeffgreco13/filament-breezy

A custom package for Filament with login flow, profile and teams support.

1.0k1.7M41](/packages/jeffgreco13-filament-breezy)[spatie/laravel-login-link

Quickly login to your local environment

4381.2M1](/packages/spatie-laravel-login-link)[ryangjchandler/laravel-cloudflare-turnstile

A simple package to help integrate Cloudflare Turnstile.

438896.6k2](/packages/ryangjchandler-laravel-cloudflare-turnstile)[spatie/laravel-passkeys

Use passkeys in your Laravel app

444494.4k16](/packages/spatie-laravel-passkeys)

PHPackages © 2026

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