PHPackages                             huy-tran/api-explorer-module - 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. huy-tran/api-explorer-module

ActiveLaravel-module[API Development](/categories/api)

huy-tran/api-explorer-module
============================

Self-hosted API explorer for local development

v0.0.21(2mo ago)0332↓25%MITBladePHP ^8.3

Since Mar 27Pushed 2mo agoCompare

[ Source](https://github.com/huy-tran/api-explorer-module)[ Packagist](https://packagist.org/packages/huy-tran/api-explorer-module)[ RSS](/packages/huy-tran-api-explorer-module/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (5)Versions (22)Used By (0)

ApiExplorer Module
==================

[](#apiexplorer-module)

A self-hosted API explorer for local development in Laravel applications. Automatically scans and documents your API routes, actions, and DTOs.

Features
--------

[](#features)

- Automatic API route discovery and documentation
- Inspect action handlers and their data structures
- View request/response schemas from DTOs and transformers
- Manage multiple environment configurations
- Per-endpoint state persistence with URL-based restoration
- Fuzzy search across all endpoints
- Fake data generation for request testing
- Dark mode support
- Zero-configuration setup for Laravel 12+ applications
- Development-only module (production disabled)

Tech Stack
----------

[](#tech-stack)

### Backend

[](#backend)

- **PHP** 8.3+
- **Laravel** 12+ (module architecture)
- **spatie/laravel-data** ^3|^4 — DTO schemas and validation
- **lorisleiva/laravel-actions** ^2.0 — Action-based route handlers

### Frontend

[](#frontend)

- **Alpine.js** 3.x — Reactive UI components
- **Tailwind CSS** — Utility-first styling (CDN)
- **Fuse.js** — Fuzzy search for endpoint filtering
- **Faker.js** 8.3.1 — Fake data generation for request fields
- **Font Awesome** 6.5.1 — Icons
- **Blade** — Server-side templating

All frontend assets are loaded via CDN — no build step required.

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

[](#requirements)

- PHP 8.3+
- Laravel 12+
- `spatie/laravel-data` ^3|^4
- `lorisleiva/laravel-actions` ^2.0

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

[](#installation)

Install the module via Composer:

```
composer require huy-tran/api-explorer-module
```

The module will be automatically registered via the service provider.

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

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --provider="Modules\\ApiExplorer\\Providers\\ApiExplorerServiceProvider" --tag=config
```

This creates `config/api-explorer.php`:

```
return [
    'enabled' => env('API_EXPLORER_ENABLED', true),
    'cache' => env('API_EXPLORER_CACHE', true),
    'cache_ttl' => env('API_EXPLORER_CACHE_TTL', 86400),
    'route_prefix' => env('API_EXPLORER_ROUTE_PREFIX', 'dev/api-explorer'),
    'exclude_patterns' => [
        'boost',
        'up',
        'storage',
    ],
];
```

OptionDefaultDescription`enabled``true`Enable or disable the module`cache``true`Cache scanned API data`cache_ttl``86400`Cache time-to-live in seconds`route_prefix``dev/api-explorer`URL prefix for the explorer routes`exclude_patterns``[...]`Route patterns to exclude from scanningThe module is **disabled in production** and only available in development environments.

Publishing Assets
-----------------

[](#publishing-assets)

To publish views for customization:

```
php artisan vendor:publish --provider="Modules\\ApiExplorer\\Providers\\ApiExplorerServiceProvider" --tag=views
```

This publishes views to `resources/views/vendor/api-explorer/`.

Usage
-----

[](#usage)

### Scan API Endpoints

[](#scan-api-endpoints)

Scan your application for API endpoints:

```
php artisan api-explorer:scan
```

This command:

- Discovers all registered routes
- Analyzes action handlers and DTOs
- Generates documentation for your API
- Caches results for performance

### Clear Cache

[](#clear-cache)

Clear the API explorer cache:

```
php artisan api-explorer:clear-cache
```

### Access the Explorer

[](#access-the-explorer)

Once enabled, visit your application's API explorer route to browse documented endpoints.

Architecture
------------

[](#architecture)

The module uses several key components:

- **RouteScanner** - Discovers and analyzes Laravel routes
- **ActionResolver** - Inspects Laravel Action handlers
- **DtoInspector** - Extracts schemas from spatie/laravel-data DTOs
- **EndpointPipeline** - Processes and enriches endpoint information
- **FieldTypeMapper** - Maps PHP types to readable schema types

DTO Integration
---------------

[](#dto-integration)

### Scalar and Enum Properties

[](#scalar-and-enum-properties)

Standard PHP types are automatically mapped to form fields:

PHP TypeInput Type`string`Text`int`, `float`Number`bool`Checkbox`array`Repeatable text items`mixed`Textarea`Carbon`, `DateTime`Datetime picker`UploadedFile`File upload`BackedEnum`Select dropdownNested `Data` classExpandable group### Eloquent Model Properties

[](#eloquent-model-properties)

Eloquent model parameters in DTOs are automatically rendered as body ID fields using a convention-based key derived from the class name:

Model classAuto-derived keyInput type`Client``clientId``number``ClientProject``clientProjectId``number``DocumentChunk``documentChunkId``number`No annotation is required for the common case:

```
class CreateDocumentData extends Data
{
    public function __construct(
        #[Required]
        public Project $project,   // → projectId (number), auto-derived

        #[Required]
        public string $title,
    ) {}
}
```

#### Overriding with `#[BodyField]`

[](#overriding-with-bodyfield)

Use `#[BodyField]` when the default key or input type doesn't fit:

```
use Modules\ApiExplorer\Attributes\BodyField;

class CreateDocumentData extends Data
{
    public function __construct(
        #[BodyField('externalRef', 'text')] // UUID key, text input
        public SomeModel $ref,

        #[BodyField('parentId')]            // custom key name
        public Project $project,
    ) {}
}
```

**Parameters:**

ParameterTypeDefaultDescription`$key``string`—The field name sent in the request body`$inputType``string``'number'`Input type rendered in the UI. Use `'text'` for UUID-keyed modelsEnvironment Management
----------------------

[](#environment-management)

Store and switch between multiple API environments:

- Save environment configurations
- Switch between development, staging, and production endpoints
- Store authentication tokens and custom headers per environment

License
-------

[](#license)

This module is licensed under the MIT License.

Author
------

[](#author)

Huy Tran -

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance83

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

Every ~0 days

Total

21

Last Release

86d ago

PHP version history (2 changes)v0.0.1PHP ^8.4

v0.0.5PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/424f71b3bfa81f602dc05dce40c528a912870cb1ea1a07870aa144287bd863be?d=identicon)[hygo.tran](/maintainers/hygo.tran)

---

Top Contributors

[![huygreenhat](https://avatars.githubusercontent.com/u/89112825?v=4)](https://github.com/huygreenhat "huygreenhat (47 commits)")

---

Tags

apilaraveldevelopmentexplorer

### Embed Badge

![Health badge](/badges/huy-tran-api-explorer-module/health.svg)

```
[![Health](https://phpackages.com/badges/huy-tran-api-explorer-module/health.svg)](https://phpackages.com/packages/huy-tran-api-explorer-module)
```

###  Alternatives

[infyomlabs/routes-explorer

Laravel Routes Explorer

3925.7k](/packages/infyomlabs-routes-explorer)

PHPackages © 2026

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