PHPackages                             ayoub-amzil/header-harmony - 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. ayoub-amzil/header-harmony

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

ayoub-amzil/header-harmony
==========================

Reusable API header profiles for Laravel apps

1.0.0(9mo ago)014MITPHPPHP ^8.0

Since Jul 18Pushed 9mo agoCompare

[ Source](https://github.com/ayoub-amzil/header-harmony)[ Packagist](https://packagist.org/packages/ayoub-amzil/header-harmony)[ RSS](/packages/ayoub-amzil-header-harmony/feed)WikiDiscussions main Synced 1mo ago

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

Header Harmony for Laravel
==========================

[](#header-harmony-for-laravel)

A lightweight Laravel package that helps you manage, organize, and retrieve custom HTTP headers using Laravel's configuration and .env setup for third-party API requests, whether for development or production. Instead of hardcoding headers in each request, centralize them in configuration and access them with a clean, simple interface.

Features
--------

[](#features)

- Clean separation of logic and configuration.
- Supports .env dynamic values (secure for production use).
- Compatible with Laravel 12.x and PHP 8.0+.
- Can be used with Laravel's HTTP client or Guzzle.
- Ready for development and production use.

Requirements
------------

[](#requirements)

- Laravel 10 / 11 / 12
- PHP 8.0+

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

[](#installation)

### 1. Require the package via Composer

[](#1-require-the-package-via-composer)

```
composer require ayoub-amzil/header-harmony
```

### 2. Publish the configuration file

[](#2-publish-the-configuration-file)

```
php artisan vendor:publish --tag=header-harmony-config
```

This will publish the config file to: `config/header-harmony.php`

Usage/Examples
--------------

[](#usageexamples)

### 1. Define services and headers in the config file

[](#1-define-services-and-headers-in-the-config-file)

Edit the `config/header-harmony.php` file:

```
'openai' => [
    'Authorization' => 'Bearer ' . env('OPENAI_KEY'),
    'Content-Type' => 'application/json',
],
'coinmarketcap' => [
    'X-CMC_PRO_API_KEY' => env('COINMARKETCAP_KEY'),
    'Accept' => 'application/json',
],
'weatherapi' => [
    'key' => env('WEATHER_API_KEY'),
    'Accept' => 'application/json',
],
'test' => [
    'Authorization' => env('TEST'),
    'Content-Type' => 'application/json',
],
```

### 2. Add your API keys to the .env file

[](#2-add-your-api-keys-to-the-env-file)

```
OPENAI_KEY=sk-xxxxx
COINMARKETCAP_KEY=ghp_xxxxxx
WEATHER_API_KEY=abc123
TEST=####
```

### 3. You're now ready to use the package!

[](#3-youre-now-ready-to-use-the-package)

Use it anywhere in your Laravel app like:

```
use HeaderHarmony\HeaderHarmony;

$headers = HeaderHarmony::for('openai');
```

Error Handling
--------------

[](#error-handling)

The `for($service)` method will throw an exception if:

- The service name is not defined in `config/header-harmony.php`

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance59

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

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

295d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab1bd32b06c03497ef0ffdb45d966028f4ac38a3b31536b27bcfdda63d604a30?d=identicon)[amzil-ayoub](/maintainers/amzil-ayoub)

---

Top Contributors

[![ayoub-amzil](https://avatars.githubusercontent.com/u/85901966?v=4)](https://github.com/ayoub-amzil "ayoub-amzil (1 commits)")

---

Tags

apiauthenticationcomposerheaderslaravelpackagephp

### Embed Badge

![Health badge](/badges/ayoub-amzil-header-harmony/health.svg)

```
[![Health](https://phpackages.com/badges/ayoub-amzil-header-harmony/health.svg)](https://phpackages.com/packages/ayoub-amzil-header-harmony)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[olssonm/l5-very-basic-auth

Laravel stateless HTTP basic auth without the need for a database

1662.5M1](/packages/olssonm-l5-very-basic-auth)[stechstudio/laravel-jwt

Helper package that makes it easy to generate, consume, and protect routes with JWT tokens in Laravel

126117.6k](/packages/stechstudio-laravel-jwt)[scaler-tech/laravel-saml2

SAML2 Service Provider integration for Laravel applications, based on OneLogin toolkit

2737.5k](/packages/scaler-tech-laravel-saml2)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)

PHPackages © 2026

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