apideck-laravel maintained by muammarsiddiqui
apideck-laravel v5.0
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.
✨ What's New in v5.0
- 💻 Multi-Language Code Generator: Generate native code snippets in JavaScript (
fetch,axios), PHP (Guzzle,cURL), and C# (HttpClient). - 📜 Request History Log: View past executions with status badges (
200 OK,404), latency metrics, and 1-click execution replay. - ⚡ Performance Load Tester: Built-in Stress Benchmarker (10, 50, 100 requests) with average latency, P95/P99 calculations, and visual latency chart.
- 📦 Postman v2.1 & OpenAPI Import/Export: 1-click Postman v2.1 Collection export + external OpenAPI / Postman spec importer.
- 🗺️ Interactive Node Visualizer: SVG canvas graph mapping API routes, feature groups, and schemas.
- 🔤 Dual Sorting: Sort collections and endpoints alphabetically (
A-Z/Z-A). - 💾 Full State Retention: Preserves parameter inputs, body text, and response results when switching endpoints.
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
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. To auto-generate Example JSON payloads and field schemas in the UI for your POST/PUT requests, strongly type-hint your controller methods or route closures:
Using a DTO / Class
class CreateUserDTO {
public string $name;
public string $email;
public int $age;
public bool $isActive;
}
Route::post('api/users', function (CreateUserDTO $payload) {
return response()->json(['success' => true]);
});
Using Form Requests
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class StoreUserRequest extends FormRequest {
public function rules() {
return [
'name' => 'required|string',
'email' => 'required|email'
];
}
}
public function store(StoreUserRequest $request) {
// ...
}
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"
License
MIT License