PHPackages                             martink/apigenerator - 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. martink/apigenerator

ActiveLibrary[API Development](/categories/api)

martink/apigenerator
====================

A Laravel package to generate CRUD and API resources.

v1.1.0(1y ago)412MITPHPPHP ^8.0|^8.1|^8.2|^8.3|^8.4

Since May 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/karadzinov/ApiGenerator)[ Packagist](https://packagist.org/packages/martink/apigenerator)[ RSS](/packages/martink-apigenerator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

ApiGenerator
============

[](#apigenerator)

[![Latest Version on Packagist](https://camo.githubusercontent.com/388a7c3cdd0e6f0a6c8276f9a20780ba58fe0372ee4e0dfafb6ba8c351ba655d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d617274696e6b2f61706967656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/martink/apigenerator)[![Total Downloads](https://camo.githubusercontent.com/1b6ed93e5835b3b36bcf36f84a2b2b65ecf8d953bde549f4c4fdbb9a847715c8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d617274696e6b2f61706967656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/martink/apigenerator)[![License](https://camo.githubusercontent.com/2e29e8e2236f32322be9a977dad83ab0570bcfc5f4cc152e2dcd0bedffc4a624/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6b617261647a696e6f762f41706947656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://github.com/karadzinov/ApiGenerator/blob/main/LICENSE)

ApiGenerator is a Laravel package that helps you generate a full CRUD stack (Model, Migration, Controller, Requests, Resource, Service, and API routes) and API scaffolding with a single Artisan command.

🚀 Installation
--------------

[](#-installation)

You can install the package via Composer:

```
composer require martink/apigenerator --dev
```

If Laravel doesn't auto-discover the service provider, add it manually in config/app.php:

```
'providers' => [
    MartinK\ApiGenerator\ApiGeneratorServiceProvider::class,
],
```

📦 Publish (if needed)

```
php artisan vendor:publish --provider="MartinK\ApiGenerator\ApiGeneratorServiceProvider"
```

⚙️ Usage Generate a Full CRUD Stack

```
php artisan generate:crud ModelName --fields="title:string,description:text" --relationships="user:belongsTo"
```

This will generate:

app/Models/ModelName.php

database/migrations/xxxx\_xx\_xx\_create\_modelname\_table.php

app/Http/Controllers/Api/ModelNameController.php

app/Http/Requests/ModelNameStoreRequest.php

app/Http/Requests/ModelNameUpdateRequest.php

app/Http/Resources/ModelNameResource.php

app/Services/ModelNameService.php

Route entry in routes/api.php

Generate API from Existing Models If your model already exists and includes $fillable, you can use:

```
php artisan generate:api
```

This command will loop through all models in app/Models and auto-generate:

Controllers

Resources

Services

Routes

🧪 Example

```
php artisan generate:crud Album --fields="name:string,coverImg:string,restaurant_id:foreignId" --relationships="restaurant:belongsTo,pictures:hasMany"
```

🗂 Generated Controller Example

```
public function update(AlbumUpdateRequest $request, Album $album)
{
    $updated = $this->service->update($album, $request->validated());
    return new AlbumResource($updated);
}
```

✅ Requirements PHP ^7.4|^8.0

Laravel 8 or 9+

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

Developed by Martin Karadzinov

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance48

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Unknown

Total

1

Last Release

382d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1df4c326f667674059508c1a8b1e21d2ee5a31dc3c5a8635e386d5f6faa2c92?d=identicon)[karadzinov](/maintainers/karadzinov)

---

Top Contributors

[![karadzinov](https://avatars.githubusercontent.com/u/7139106?v=4)](https://github.com/karadzinov "karadzinov (3 commits)")

### Embed Badge

![Health badge](/badges/martink-apigenerator/health.svg)

```
[![Health](https://phpackages.com/badges/martink-apigenerator/health.svg)](https://phpackages.com/packages/martink-apigenerator)
```

###  Alternatives

[spatie/laravel-query-builder

Easily build Eloquent queries from API requests

4.4k26.9M220](/packages/spatie-laravel-query-builder)[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)[simplestats-io/laravel-client

Client for SimpleStats!

4515.5k](/packages/simplestats-io-laravel-client)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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