PHPackages                             evrenonur/api-lens - 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. evrenonur/api-lens

ActiveLibrary[API Development](/categories/api)

evrenonur/api-lens
==================

Auto-generated, interactive API documentation for Laravel with a modern Vue 3 UI. Zero config, real-time testing, code snippets, OpenAPI export.

1.5.0(2mo ago)695MITPHPPHP ^8.1CI passing

Since Feb 26Pushed 2mo agoCompare

[ Source](https://github.com/evrenonur/api-lens)[ Packagist](https://packagist.org/packages/evrenonur/api-lens)[ RSS](/packages/evrenonur-api-lens/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (13)Used By (0)

API Lens
========

[](#api-lens)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2c741631c36c9d9c9818f58202029ac01a11363884b6276a6f48cc65e4efe25b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f657672656e6f6e75722f6170692d6c656e733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/evrenonur/api-lens)[![Total Downloads](https://camo.githubusercontent.com/0f852bcd4690a52adce80c9291d9fddb97bfa86e193fbeebb8d78cb4eaf102cc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f657672656e6f6e75722f6170692d6c656e733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/evrenonur/api-lens)[![License: MIT](https://camo.githubusercontent.com/1b01ef0024ba0866c115986b895301f657c1b21fc29f05c4844b7f2e8d89204d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/1ca6e54afa4f26cf6730d668d4569ff8352a684bbebd7bf79bdc687189ca14ee/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f657672656e6f6e75722f6170692d6c656e733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/evrenonur/api-lens)[![Laravel](https://camo.githubusercontent.com/c45f9843cdb48719a12ab2b4554c03cfb19a6adcc9a70cbdd2707fa47b906da1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302e7825323025374325323031312e7825323025374325323031322e782d4646324432303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c266c6f676f436f6c6f723d7768697465)](https://laravel.com)[![Vue.js](https://camo.githubusercontent.com/8592ffbafffec1698a4f92eee27e7c68d99e8c89e1bd7f0d52f63773dd45dbf2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5675652e6a732d332e782d3446433038443f7374796c653d666c61742d737175617265266c6f676f3d7675652e6a73266c6f676f436f6c6f723d7768697465)](https://vuejs.org)[![GitHub Stars](https://camo.githubusercontent.com/633aeaf35f8428091c4a11b850cfd0b9b4a4b5da3d15a903bc23db99f582dcc0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f657672656e6f6e75722f6170692d6c656e733f7374796c653d736f6369616c)](https://github.com/evrenonur/api-lens)

**Auto-generated, interactive API documentation for Laravel.**

Zero config. Real-time testing. Modern Vue 3 UI. OpenAPI export.

---

Features
--------

[](#features)

- **Zero Configuration** — Drop in, visit `/api-lens`, done
- **Auto Route Scanning** — Discovers all API routes, controllers, validation rules
- **Smart Rule Extraction** — Parses `FormRequest`, inline `$request->validate()`, and controller rules
- **Response Schema Detection** — Analyzes `JsonResource` / `ResourceCollection` classes automatically
- **Path Parameter Analysis** — Detects route model binding types and constraints
- **PHPDoc Integration** — Reads `@api-lens-group`, `@api-lens-auth`, `@deprecated` annotations
- **Live API Testing** — Send requests directly from the browser, see response + SQL queries + memory
- **Code Snippets** — Auto-generated cURL, JavaScript (fetch/axios), Python, PHP (Guzzle/HTTP) snippets
- **Human-Readable Rules** — Transforms `required|string|max:255` into plain English
- **Example Generation** — Smart request body examples based on field names and rules
- **Rate Limit Info** — Extracts throttle middleware configuration
- **OpenAPI 3.1.0 Export** — Full spec export for Swagger UI, Postman, etc.
- **Postman Collection Export** — Direct Postman v2.1 collection generation
- **API Version Diff** — Compare endpoints between versions, generate changelogs
- **Dark Mode** — Beautiful dark/light theme with system preference detection
- **Keyboard Shortcuts** — `Ctrl+K` search, arrow navigation, Enter to select
- **Debug Metrics** — SQL query count/time, memory usage, execution time per request

Screenshots
-----------

[](#screenshots)

 [![API Lens - Endpoint List](docs/screenshots/1.png)](docs/screenshots/1.png)

 [![API Lens - Endpoint Detail](docs/screenshots/2.png)](docs/screenshots/2.png)

 [![API Lens - Live Testing](docs/screenshots/3.png)](docs/screenshots/3.png)

 [![API Lens - Response & Metrics](docs/screenshots/4.png)](docs/screenshots/4.png)

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

[](#requirements)

- PHP 8.1+
- Laravel 10, 11, or 12

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

[](#installation)

```
composer require evrenonur/api-lens --dev
```

Publish the config (optional):

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

Visit your app at:

```
http://your-app.test/api-lens

```

That's it!

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

[](#configuration)

```
// config/api-lens.php

return [
    'enabled' => env('API_LENS_ENABLED', true),

    'path' => 'api-lens',

    'middleware' => ['web'],

    'include_patterns' => ['api/*'],

    'exclude_patterns' => [
        'sanctum/*',
        '_ignition/*',
        'telescope/*',
        'horizon/*',
        'api-lens/*',
    ],

    'auth' => [
        'enabled' => false,
        'middleware' => [],
    ],

    'features' => [
        'live_testing' => true,
        'code_snippets' => true,
        'openapi_export' => true,
        'debug_metrics' => true,
        'example_generation' => true,
    ],

    'code_snippets' => [
        'languages' => ['curl', 'javascript', 'python', 'php', 'axios', 'fetch', 'guzzle', 'http'],
    ],

    'cache' => [
        'enabled' => false,
        'ttl' => 3600,
    ],
];
```

PHPDoc Annotations
------------------

[](#phpdoc-annotations)

Add annotations to your controller methods for richer documentation:

```
/**
 * @api-lens-group Users
 */
class UserController extends Controller
{
    /**
     * List all users.
     *
     * Returns a paginated list of users with optional filtering.
     *
     * @api-lens-auth bearer
     * @api-lens-tag admin
     * @api-lens-response 200 {"data": [{"id": 1, "name": "John"}], "meta": {"total": 50}}
     */
    public function index(Request $request)
    {
        // ...
    }

    /**
     * Create a new user.
     *
     * @api-lens-response 201 {"data": {"id": 1, "name": "John"}, "message": "User created"}
     */
    public function store(StoreUserRequest $request)
    {
        // ...
    }

    /**
     * Delete user.
     *
     * @api-lens-deprecated 2025-06-01 Use PATCH /users/{user}/deactivate instead
     */
    public function destroy(User $user)
    {
        // ...
    }
}
```

### Available Annotations

[](#available-annotations)

AnnotationLevelDescription`@api-lens-group Name`ClassGroup endpoints under a section`@api-lens-auth bearer|basic|api-key`Class/MethodAuthentication type`@api-lens-tag name`MethodCustom tag`@api-lens-response {code} {json?}`MethodResponse code with optional JSON example`@api-lens-deprecated {date} {message}`MethodMark as deprecated with migration infoOpenAPI Export
--------------

[](#openapi-export)

### Via Artisan

[](#via-artisan)

```
# Export as OpenAPI 3.1.0 JSON
php artisan api-lens:export docs/openapi.json --format=openapi

# Export as Postman Collection
php artisan api-lens:export docs/postman.json --format=postman

# Default export (api.json in project root)
php artisan api-lens:export

# Overwrite without confirmation
php artisan api-lens:export docs/openapi.json --format=openapi --force
```

### Via API

[](#via-api)

```
GET /api-lens/export/openapi
GET /api-lens/export/postman

```

Live Testing
------------

[](#live-testing)

The built-in API tester lets you:

1. Set custom headers (Authorization, Content-Type, etc.)
2. Edit JSON request body with smart defaults
3. See response status, headers, and formatted body
4. View debug metrics: SQL queries, memory usage, execution time

Enable the debug middleware in your config to capture metrics:

```
'features' => [
    'debug_metrics' => true,
],
```

Building the Frontend
---------------------

[](#building-the-frontend)

The Vue 3 frontend is pre-built. To develop or customize:

```
cd ui
npm install
npm run dev    # Development with HMR
npm run build  # Production build
```

Built assets are served from the package automatically.

Security
--------

[](#security)

API Lens is intended for **development environments only**. To protect in production:

```
// config/api-lens.php
'enabled' => env('API_LENS_ENABLED', false),

// Or add auth middleware
'auth' => [
    'enabled' => true,
    'middleware' => ['auth:sanctum', 'can:view-api-docs'],
],
```

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance84

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

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

12

Last Release

81d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1fc8601ce58b58037771714731b5909d88b0e08cb3d2e5fcf8e28799dd5376fa?d=identicon)[evrenonur](/maintainers/evrenonur)

---

Top Contributors

[![evrenonur](https://avatars.githubusercontent.com/u/49561437?v=4)](https://github.com/evrenonur "evrenonur (14 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (11 commits)")

---

Tags

apilaraveldocumentationswaggeropenapiauto-documentationvue3

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

2.9k34.0M112](/packages/darkaonline-l5-swagger)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)

PHPackages © 2026

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