PHPackages                             dandoetech/laravel-openapi-generator - 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. dandoetech/laravel-openapi-generator

ActiveLibrary[API Development](/categories/api)

dandoetech/laravel-openapi-generator
====================================

Laravel bridge for DanDoeTech OpenAPI generator: artisan export command and wiring.

v0.2.0(3mo ago)20MITPHPPHP ^8.2CI passing

Since Mar 15Pushed 3mo agoCompare

[ Source](https://github.com/dandoetech/laravel-openapi-generator)[ Packagist](https://packagist.org/packages/dandoetech/laravel-openapi-generator)[ Docs](https://github.com/dandoetech/laravel-openapi-generator)[ RSS](/packages/dandoetech-laravel-openapi-generator/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (11)Versions (3)Used By (0)

Laravel OpenAPI Generator
=========================

[](#laravel-openapi-generator)

> **Pre-release** — Architecture by senior tech lead, implementation largely AI-assisted with human review. Not fully reviewed. Architecture may change before v1.0.0.

Laravel bridge for the DanDoeTech OpenAPI generator. Provides an Artisan command to export OpenAPI 3.1 specs from the Resource Registry.

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

[](#installation)

```
composer require dandoetech/laravel-openapi-generator
```

The service provider is auto-discovered. Publish the config:

```
php artisan vendor:publish --tag=ddt-openapi-config
```

Requires [`dandoetech/laravel-resource-registry`](https://github.com/dandoetech/laravel-resource-registry).

Quick Start
-----------

[](#quick-start)

Export the spec:

```
php artisan openapi:export
```

This generates an OpenAPI 3.1 JSON file at `storage/app/openapi.json` (configurable).

Override title or version:

```
php artisan openapi:export --title="Catalog API" --oaversion="2.0.0"
php artisan openapi:export --output="public/openapi.json"
```

### What Gets Generated

[](#what-gets-generated)

Every registered resource produces:

- `GET /{resource}` — list endpoint
- `POST /{resource}` — create endpoint
- `GET /{resource}/{id}` — show endpoint
- A component schema with all fields and computed fields

Example output (abbreviated):

```
{
  "openapi": "3.1.0",
  "info": { "title": "API", "version": "1.0.0" },
  "servers": [{ "url": "http://localhost/api", "description": "Primary API" }],
  "paths": {
    "/product": {
      "get": { "summary": "List Product" },
      "post": { "summary": "Create Product" }
    },
    "/product/{id}": {
      "get": { "summary": "Fetch Product" }
    }
  },
  "components": {
    "schemas": {
      "Product": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "price": { "type": "number", "format": "double" },
          "category_name": { "type": "string" }
        },
        "required": ["name", "price"]
      },
      "ProblemJson": { "..." : "..." }
    }
  }
}
```

Computed fields (like `category_name`) appear in schemas as regular properties. Error responses use the RFC 7807 `ProblemJson` schema.

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

[](#configuration)

`config/ddt_openapi.php`:

```
return [
    // OpenAPI info block
    'title'   => env('OPENAPI_TITLE', 'API'),
    'version' => env('OPENAPI_VERSION', '1.0.0'),

    // Output path relative to storage_path()
    'output'  => env('OPENAPI_OUTPUT', 'app/openapi.json'),
];
```

The server URL is built from `config('app.url')` and the API prefix from `config('ddt_api.prefix')` (configured in [`laravel-generic-api`](https://github.com/dandoetech/laravel-generic-api)).

Programmatic Use
----------------

[](#programmatic-use)

Generate the spec in code:

```
use DanDoeTech\LaravelOpenApiGenerator\Services\OpenApiGenerator;

$generator = app(OpenApiGenerator::class);
$spec = $generator->create(); // array

return response()->json($spec);
```

API Overview
------------

[](#api-overview)

ClassPurpose`OpenApiServiceProvider`Registers config, artisan command`OpenApiExportCommand``openapi:export` with `--output`, `--title`, `--oaversion` options`OpenApiGenerator` (service)Builds spec from Registry + config, returns arrayTesting
-------

[](#testing)

```
composer install
composer test        # PHPUnit (Orchestra Testbench)
composer qa          # cs:check + phpstan + test
```

License
-------

[](#license)

MIT

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance82

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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 ~4 days

Total

2

Last Release

95d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7db403e7ef98a1eb428f771172dfa0edbd6f7c72d217fad0571992bee2cc089d?d=identicon)[dandoetech](/maintainers/dandoetech)

---

Top Contributors

[![dandoetech](https://avatars.githubusercontent.com/u/5097406?v=4)](https://github.com/dandoetech "dandoetech (29 commits)")

---

Tags

phplaravelswaggeropenapiartisan

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dandoetech-laravel-openapi-generator/health.svg)

```
[![Health](https://phpackages.com/badges/dandoetech-laravel-openapi-generator/health.svg)](https://phpackages.com/packages/dandoetech-laravel-openapi-generator)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

9782.1M161](/packages/laravel-ai)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.5k](/packages/larastan-larastan)[laravel/sail

Docker files for running a basic Laravel application.

1.9k199.2M1.2k](/packages/laravel-sail)[moonshine/moonshine

Laravel administration panel

1.3k239.9k75](/packages/moonshine-moonshine)[illuminate/queue

The Illuminate Queue package.

20432.2M1.5k](/packages/illuminate-queue)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9742.3M121](/packages/roots-acorn)

PHPackages © 2026

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