Skip to main content
Geni is an open-source static-analysis OpenAPI 3.1.0 specification generator and documentation portal for Laravel applications. Instead of booting your application kernel or querying a live database, Geni traverses your source code as an abstract syntax tree (AST), connecting the information already encoded in your migrations, Form Requests, and Eloquent API Resources into a complete, accurate API specification — automatically.

What problem does Geni solve?

Most API documentation generators in the PHP ecosystem fall into one of two traps. The first trap is heavy runtime execution: they boot your Laravel application, run service providers, execute database migrations against a live connection, and instantiate models — making them slow, brittle in CI, and impossible to run in locked-down environments. The second trap is heavy manual annotation: they require dozens of verbose docblock comments or attributes on every controller method, duplicating information you have already expressed in your Form Requests, migrations, and resources. Geni avoids both traps by reading what you already wrote:
  • Your migration files define your column names and types. Geni reconstructs the full database schema from them offline.
  • Your Form Request classes define your validation rules. Geni converts those rules into OpenAPI request body schemas.
  • Your Eloquent API Resources define your response shapes. Geni maps them to OpenAPI response schemas.
  • If you already use Scramble-compatible PHPDoc annotations or attributes, Geni recognises them without any breaking changes.

Key capabilities

Zero Database Connections

Reconstructs full database schemas directly from migration files offline. No database connection or test database is ever required.

Zero Application Boot

Infers requests, responses, models, and parameters via AST parsing. The Laravel kernel is never booted and no controller code is ever executed.

Interactive Docs Portal

Ships a built-in Blade and Alpine.js documentation portal with live search, syntax highlighting, and a Try It console — no JavaScript build step needed.

AI Agent Ready

Includes a built-in Model Context Protocol (MCP) server and tool manifest generator for Claude Desktop, Cursor, and Claude Code.

Feature details

Geni supports Laravel 10.x, 11.x, 12.x, and 13.x running on PHP 8.2, 8.3, and 8.4. You get full static-analysis coverage across every actively maintained Laravel release without needing to update your documentation tooling when you upgrade the framework.
Geni provides first-class, opt-in static analysis support for three widely used Laravel packages:
  • spatie/laravel-data — Data Transfer Objects are parsed for their property types and validation attributes, producing accurate request and response schemas.
  • spatie/laravel-query-builder — Allowed filters, sorts, and includes are detected statically and surfaced as query parameter definitions in your specification.
  • lorisleiva/laravel-actions — Action classes that double as controllers and jobs are fully resolved, so their rules and responses appear in your docs automatically.
Serve multiple versioned API specifications — for example v1, v2, and internal — from a single Geni installation. Each version gets its own specification and is accessible through an interactive version-switcher dropdown in the documentation portal sidebar.
Documentation routes are restricted to the local environment by default, so your API specification is never publicly accessible on production without explicit configuration. When you do need to expose docs on non-local environments, Geni provides built-in support for form-based login and HTTP Basic Authentication.

CI drift detection

Use php artisan geni:check --path=openapi.json in your CI pipeline to verify that a committed OpenAPI specification stays in sync with your source code. If any route, parameter, or schema has changed since the file was committed, the command exits with code 1 and prints a human-readable diff. This gives you a hard gate against documentation drift with no extra tooling required.

Install Geni

Add masitings/geni-api to your Laravel project and publish the configuration file.