muammarsiddiqui/apideck-laravel

Lightweight, beautiful, zero-config API playground and explorer for Laravel APIs

Maintainers

Package info

github.com/MuammarSiddiqui/apideck-laravel

Language:JavaScript

pkg:composer/muammarsiddiqui/apideck-laravel

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2026-05-26 06:47 UTC

This package is auto-updated.

Last update: 2026-05-26 06:48:03 UTC


README

Lightweight, beautiful, zero-config API playground and explorer for Laravel APIs.

ApiDeck automatically inspects your Laravel routes and controllers to generate a stunning UI allowing you to browse, test, and document your API without writing manual OpenAPI YAML files or docblocks.

Features

  • Zero Config: Just require the package and visit /apideck.
  • Dynamic Schema Reflection: ApiDeck uses PHP Reflection to automatically read your type-hinted Controller parameters (DTOs, FormRequests) and generate JSON examples in the UI!
  • Modern UI: Sleek, fully responsive, dark-mode ready interface.
  • Native Integration: Seamlessly integrates with Laravel's internal router.

Installation

Install the package via Composer:

composer require muammarsiddiqui/apideck-laravel

Because of Laravel's package auto-discovery, the service provider will be registered automatically!

Quick Start

You don't need to do anything. Simply define your routes in routes/api.php or routes/web.php:

Route::prefix('api/v1')->group(function () {
    Route::get('users', [UserController::class, 'index']);
    Route::post('users', [UserController::class, 'store']);
});

Then open http://localhost:8000/apideck in your browser!

(Note: ApiDeck automatically filters out routes that don't belong to your API to keep the interface clean).

Advanced: Dynamic Schema Reflection (Auto-Example Generation)

ApiDeck features a powerful PHP Reflection engine. If you want ApiDeck to automatically generate Example JSON payloads and field schemas in the UI for your POST/PUT requests, all you have to do is strongly type-hint your controller methods or route closures!

Using a DTO / Class

If you type-hint a custom class, ApiDeck will read its public properties:

// Define your DTO class
class CreateUserDTO {
    public string $name;
    public string $email;
    public int $age;
    public bool $isActive;
}

// In your routes or controller:
Route::post('api/users', function (CreateUserDTO $payload) {
    return response()->json(['success' => true]);
});

Using Form Requests

If you type-hint a standard Laravel FormRequest, ApiDeck will try to instantiate it and parse its rules() array to map out the fields:

namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;

class StoreUserRequest extends FormRequest {
    public function rules() {
        return [
            'name' => 'required|string',
            'email' => 'required|email'
        ];
    }
}

// In your controller
public function store(StoreUserRequest $request) {
    // ...
}

ApiDeck will automatically reflect on these injected parameters and display fully populated JSON example payloads in the interface!

Configuration (Optional)

If you need to change the base URL or other behavior, publish the config file:

php artisan vendor:publish --provider="ApiDeck\Laravel\ApiDeckServiceProvider"