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(2d ago)20MITPHPPHP ^8.2CI passing

Since Mar 15Pushed 2d 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 today

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

38

—

LowBetter than 86% of packages

Maintenance99

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

2d 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

[kirschbaum-development/laravel-openapi-validator

Automatic OpenAPI validation for Laravel HTTP tests

581.1M4](/packages/kirschbaum-development-laravel-openapi-validator)[scalar/laravel

Render your OpenAPI-based API reference

6065.3k2](/packages/scalar-laravel)[erasys/openapi-php

Open API 3.0 builder and validation library for PHP that helps you write valid specs.

2079.0k4](/packages/erasys-openapi-php)[hcesrl/laravel-swagger-api

API Swagger UI package for Laravel.

695.6k](/packages/hcesrl-laravel-swagger-api)

PHPackages © 2026

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