PHPackages                             juzaweb/api - 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. [API Development](/categories/api)
4. /
5. juzaweb/api

ActiveLibrary[API Development](/categories/api)

juzaweb/api
===========

Api Module

1.0.4(yesterday)0266↑599.2%GPL-2.0PHPPHP ^8.2CI passing

Since Feb 8Pushed yesterdayCompare

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

READMEChangelog (5)Dependencies (6)Versions (11)Used By (0)

Juzaweb API Module
==================

[](#juzaweb-api-module)

The **Juzaweb API Module** (`juzaweb/api`) provides a robust authentication mechanism for Juzaweb CMS applications. It introduces API Key authentication via the `x-api-key` header while seamlessly falling back to Laravel Passport for OAuth2 token-based authentication. This module also includes an administrative interface for managing API keys.

Features
--------

[](#features)

- **Dual Authentication**: Support for both API Keys (`x-api-key`) and OAuth2 Access Tokens (Laravel Passport).
- **Secure Key Management**: API Keys are automatically hashed (SHA-256) upon creation. Plain-text keys are shown only once.
- **Admin Interface**: Built-in interface to create, list, and revoke API keys within the Juzaweb admin panel.
- **Expiration &amp; Revocation**: Support for key expiration dates and manual revocation.
- **Usage Tracking**: Tracks the last usage timestamp for each API key.
- **Configurable**: Easy configuration via standard Laravel config files.

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

[](#installation)

You can install the package via composer:

```
composer require juzaweb/api
```

Configuration
-------------

[](#configuration)

### 1. Publish Configuration

[](#1-publish-configuration)

Publish the configuration file to `config/jw-api.php`:

```
php artisan vendor:publish --tag=api-config
```

### 2. Run Migrations

[](#2-run-migrations)

Run the migrations to create the necessary tables (`api_keys`, `oauth_clients`, etc.):

```
php artisan migrate
```

### 3. Configure Authentication Guard

[](#3-configure-authentication-guard)

Update your `config/auth.php` to use the `juzaweb` driver for your API guard. This driver prioritizes the `x-api-key` header and falls back to Passport's `passport` driver if no key is present.

```
'guards' => [
    'api' => [
        'driver' => 'juzaweb',
        'provider' => 'users',
    ],
    // ...
],
```

Usage
-----

[](#usage)

### Authentication

[](#authentication)

To authenticate a request using an API Key, include the `x-api-key` header in your HTTP request:

```
GET /api/user HTTP/1.1
Host: your-app.com
Accept: application/json
x-api-key: YOUR_GENERATED_API_KEY
```

If the `x-api-key` is valid, the request will be authenticated as the user associated with that key. If the header is missing or invalid, the guard will attempt to authenticate using a Bearer token (Laravel Passport).

### Managing API Keys

[](#managing-api-keys)

1. Log in to the Juzaweb Admin Panel.
2. Navigate to **Settings &gt; API Keys** (or the configured menu location).
3. Click **Add New** to generate a new API Key.
4. **Important**: Copy the generated key immediately. It will not be shown again.
5. You can view the list of active keys, their expiration status, and last usage time.
6. To revoke a key, simply delete it from the list.

License
-------

[](#license)

The Juzaweb API Module is open-sourced software licensed under the [GPL-2.0 license](LICENSE).

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance100

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 68.5% 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 ~10 days

Total

5

Last Release

1d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3169e8a8781068840e9300a57785089da521287dbe0279fc9cc7e8de1c1d95a9?d=identicon)[juzaweb](/maintainers/juzaweb)

---

Top Contributors

[![juzaweb](https://avatars.githubusercontent.com/u/47020363?v=4)](https://github.com/juzaweb "juzaweb (50 commits)")[![google-labs-jules[bot]](https://avatars.githubusercontent.com/in/842251?v=4)](https://github.com/google-labs-jules[bot] "google-labs-jules[bot] (23 commits)")

---

Tags

apilaravelmodulejuzaweb

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/juzaweb-api/health.svg)

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

###  Alternatives

[joy/voyager-api

This Laravel/Voyager module adds REST Api with swagger support to Voyager.

194.7k3](/packages/joy-voyager-api)

PHPackages © 2026

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