PHPackages                             miladev/lara-swagger - 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. miladev/lara-swagger

ActiveLibrary[API Development](/categories/api)

miladev/lara-swagger
====================

Swagger model generator based on Laravel migrations

v1.0.5(7mo ago)17MITPHPPHP ^8.0CI passing

Since Nov 15Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/miladev95/lara-swagger)[ Packagist](https://packagist.org/packages/miladev/lara-swagger)[ RSS](/packages/miladev-lara-swagger/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (3)Versions (7)Used By (0)

Laravel Swagger
===============

[](#laravel-swagger)

[![Latest Stable Version](https://camo.githubusercontent.com/c9e8fbd41900c9d93fab45f7c42d9e1cf4927d914611e45fcdfe49f5658a1d7b/68747470733a2f2f706f7365722e707567782e6f72672f6d696c616465762f6c6172612d737761676765722f76)](https://packagist.org/packages/miladev/lara-swagger)[![License](https://camo.githubusercontent.com/b2d47d3c4a4c3ff0a28448ad7904a06efa32a04bf2d3d5e0483c6bddcad6a074/68747470733a2f2f706f7365722e707567782e6f72672f6d696c616465762f6c6172612d737761676765722f6c6963656e7365)](https://packagist.org/packages/miladev/lara-swagger)[![Total Downloads](https://camo.githubusercontent.com/f17ba41a7ff1b51edda6d1a6ce5cead2efb6fffb8e870a110cf26118978be593/68747470733a2f2f706f7365722e707567782e6f72672f6d696c616465762f6c6172612d737761676765722f646f776e6c6f616473)](https://packagist.org/packages/miladev/lara-swagger)[![CI & Release](https://github.com/miladev95/lara-swagger/actions/workflows/ci-release.yml/badge.svg)](https://github.com/miladev95/lara-swagger/actions/workflows/ci-release.yml)

A Swagger model generator based on migrations

---

if you bored to create swagger models from your laravel application this package can help you.

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

[](#installation)

You can install the package via composer:

```
composer require miladev/lara-swagger
```

Usage
-----

[](#usage)

```
php artisan lswagger:generate
```

This command will create swagger\_models.js file which contains all models of your laravel application

Testing
-------

[](#testing)

This package uses PHPUnit and Orchestra Testbench.

- Prerequisites: PHP 8.2+ and Composer
- Install dev dependencies:

```
composer install
```

If you do not have a global Composer installed, you can use a local PHAR inside the project:

```
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php --install-dir=. --filename=composer.phar
php -r "unlink('composer-setup.php');"
php composer.phar install
```

- Run the tests:

```
composer test
# or
vendor/bin/phpunit
# or a specific test file
vendor/bin/phpunit tests/Feature/CreateSwaggerCommandTest.php
```

If you run tests from an IDE, ensure the working directory is the project root so the generated `swagger_models.json` can be found.

Roadmap
-------

[](#roadmap)

- Support enum types
- Support all kind of migrations (Rename,Delete,...)

If you want to contribute, open a pull request by following Laravel contribution guide.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance62

Regular maintenance activity

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

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

Total

6

Last Release

229d ago

PHP version history (3 changes)v1.0.0PHP ^8.2

v1.0.1PHP ^8.1

v1.0.2PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/35612406?v=4)[Milad](/maintainers/miladev95)[@miladev95](https://github.com/miladev95)

---

Top Contributors

[![miladev95](https://avatars.githubusercontent.com/u/35612406?v=4)](https://github.com/miladev95 "miladev95 (16 commits)")

---

Tags

swaggerlaravel swaggerswagger model

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/miladev-lara-swagger/health.svg)

```
[![Health](https://phpackages.com/badges/miladev-lara-swagger/health.svg)](https://phpackages.com/packages/miladev-lara-swagger)
```

###  Alternatives

[kirschbaum-development/laravel-openapi-validator

Automatic OpenAPI validation for Laravel HTTP tests

581.3M5](/packages/kirschbaum-development-laravel-openapi-validator)[api-platform/laravel

API Platform support for Laravel

58170.8k13](/packages/api-platform-laravel)

PHPackages © 2026

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