PHPackages                             dminustin/laravel-api-factory - 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. dminustin/laravel-api-factory

ActiveLibrary[API Development](/categories/api)

dminustin/laravel-api-factory
=============================

All-in-one flexible and customizable code generator for Laravel framework that will save you time. This tool will help you generate resources like controllers, routes, swagger doc, postman collection.

1.3.0.4(3y ago)237MITPHPPHP 8.0|^8.0

Since Jan 7Pushed 3y ago1 watchersCompare

[ Source](https://github.com/dminustin/laravel-api-factory)[ Packagist](https://packagist.org/packages/dminustin/laravel-api-factory)[ Docs](https://github.com/dminustin/laravel-api-factory)[ RSS](/packages/dminustin-laravel-api-factory/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (12)Versions (8)Used By (0)

All in one Laravel API Factory
==============================

[](#all-in-one-laravel-api-factory)

[![Latest Stable Version](https://camo.githubusercontent.com/4a8c9eadefea0e0a99f813398ee63beb9d057fe6c418645b05bc2c9a7c49cd2e/687474703a2f2f706f7365722e707567782e6f72672f646d696e757374696e2f6c61726176656c2d6170692d666163746f72792f76)](https://packagist.org/packages/dminustin/laravel-api-factory) [![Total Downloads](https://camo.githubusercontent.com/a1be84a3183d58a91d7459c43066d3d7148ab512b3e59b826ce089d9e7f41b47/687474703a2f2f706f7365722e707567782e6f72672f646d696e757374696e2f6c61726176656c2d6170692d666163746f72792f646f776e6c6f616473)](https://packagist.org/packages/dminustin/laravel-api-factory) [![Latest Unstable Version](https://camo.githubusercontent.com/3c5ef4abe6047089fbef4fff45ca46ee7523616e8d3cc7c1d4f55daaf36242ce/687474703a2f2f706f7365722e707567782e6f72672f646d696e757374696e2f6c61726176656c2d6170692d666163746f72792f762f756e737461626c65)](https://packagist.org/packages/dminustin/laravel-api-factory) [![License](https://camo.githubusercontent.com/15cd489cdf40b3ae9d6da8dd36881512f2f8d41fd53c5c1fe115fdc26671d76e/687474703a2f2f706f7365722e707567782e6f72672f646d696e757374696e2f6c61726176656c2d6170692d666163746f72792f6c6963656e7365)](https://packagist.org/packages/dminustin/laravel-api-factory) [![PHP Version Require](https://camo.githubusercontent.com/38226ac9a314edbd6d433835b0a89ad480629ac6a2dd0addf24da365e35767e5/687474703a2f2f706f7365722e707567782e6f72672f646d696e757374696e2f6c61726176656c2d6170692d666163746f72792f726571756972652f706870)](https://packagist.org/packages/dminustin/laravel-api-factory)

All-in-one flexible and customizable code generator for Laravel framework that will save you time. This tool will help you generate resources like controllers, routes, swagger doc, postman collection.

It makes:

- Controllers
- Actions
- Routes
- Swagger Documentation
- Postman collection
- Unit tests for Actions

All my Laravel`s projects I have one pain: there is necessary to create routes, controllers, validators and such more routines. From project to project I have to do same actions.
For this purpose, I wrote a composer component that helps me to make easily all of my tasks. I hope that my component will be helpful for other Laravel programmers.
I will be glad to any feedback, comments, suggestions

### The general philosophy is:

[](#the-general-philosophy-is)

"Actions" are contains all functionality, you may want to use it without HTTP requests, for example, in workers

"Controllers" must call "Actions" for any actions and must return an action result. No logic in controllers

Default Directory/files structure:

```
config
 | api-factory.php
app
| routes
    | example.yaml
| http
  | ApiFactory
    | Actions
      | ...
    | Controllers
      | ...

```

Paths and filenames can changed in the api-factory.php file
Routes directives you can see in [ROUTES](ROUTES.md).
Controllers are extends the ApiFactoryController
Actions are extends the ApiFactoryAction
You can change parent classes in stubs

Do not forget to add an exception in your app/Http/Middleware/VerifyCsrfToken.php file

```
    //just example
    protected $except = [
        '/api/*'
    ];
```

Todo
----

[](#todo)

- implement middlewares in routes

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

[](#installation)

You can install the package via composer:

```
composer require dminustin/laravel-api-factory
```

Swagger documentation
---------------------

[](#swagger-documentation)

```
composer require --dev DarkaOnLine/L5-Swagger
```

API Documentation will be available at /api/documentation

```
http://127.0.0.1:8000/api/documentation

```

Configure
---------

[](#configure)

```
php artisan vendor:publish --tag=api-factory
```

Change the configuration file config/api-factory.php

You can change ./stubs files

- api\_factory\_action
- api\_factory\_controller
- api\_factory\_router

Usage
-----

[](#usage)

```
php artisan api:factory
```

Step-by-step route creation
---------------------------

[](#step-by-step-route-creation)

```
php artisan api:create
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

License
-------

[](#license)

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

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Recently: every ~27 days

Total

7

Last Release

1155d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2a61a1f065c8f27bb8fe832eb173ee339df40dadc8da4b4572be03e4879c9bed?d=identicon)[dminustin](/maintainers/dminustin)

---

Top Contributors

[![dminustin](https://avatars.githubusercontent.com/u/4050111?v=4)](https://github.com/dminustin "dminustin (24 commits)")

---

Tags

apilaravelroutesrouterswaggerexportcollectiongeneratePostmanpostman collectionlaravel-api-factorycontrollers generator

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dminustin-laravel-api-factory/health.svg)

```
[![Health](https://phpackages.com/badges/dminustin-laravel-api-factory/health.svg)](https://phpackages.com/packages/dminustin-laravel-api-factory)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M203](/packages/laravel-ai)[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)

PHPackages © 2026

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