PHPackages                             macropay-solutions/php-crufd-wizard-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. [HTTP &amp; Networking](/categories/http)
4. /
5. macropay-solutions/php-crufd-wizard-generator

ActiveLibrary[HTTP &amp; Networking](/categories/http)

macropay-solutions/php-crufd-wizard-generator
=============================================

Library for php-crufd-wizard class generation

1.0.0-RC-4(1mo ago)2311MITPHPPHP ^8.0.0

Since Jun 27Pushed 1mo agoCompare

[ Source](https://github.com/macropay-solutions/php-crufd-wizard-generator)[ Packagist](https://packagist.org/packages/macropay-solutions/php-crufd-wizard-generator)[ RSS](/packages/macropay-solutions-php-crufd-wizard-generator/feed)WikiDiscussions production Synced 2w ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (1)

php-crufd-wizard-generator
==========================

[](#php-crufd-wizard-generator)

[![Total Downloads](https://camo.githubusercontent.com/6192700c938da43532a68a00a1c360718a5908dcf6c5bd95472ab0cbcb8d2c5e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6163726f7061792d736f6c7574696f6e732f7068702d63727566642d77697a6172642d67656e657261746f72)](https://packagist.org/packages/macropay-solutions/php-crufd-wizard-generator)[![Latest Stable Version](https://camo.githubusercontent.com/d11ae9145577fa0238a97d3d2a35534bbc04e0befea14f110f8bd8fbc5e78e07/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6163726f7061792d736f6c7574696f6e732f7068702d63727566642d77697a6172642d67656e657261746f72)](https://packagist.org/packages/macropay-solutions/php-crufd-wizard-generator)[![License](https://camo.githubusercontent.com/1e1c67289b231c75c3301756d4e0334120fdfcfd5634e5ec748bc65165cbfa9e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6163726f7061792d736f6c7574696f6e732f7068702d63727566642d77697a6172642d67656e657261746f72)](https://packagist.org/packages/macropay-solutions/php-crufd-wizard-generator)

Library for RetrieveQL [php-crufd-wizard](https://github.com/macropay-solutions/php-crufd-wizard) and for [php-crufd-wizard-decorator](https://github.com/macropay-solutions/php-crufd-wizard-decorator)

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

[](#installation)

1\. Run composer command:

`composer require macropay-solutions/php-crufd-wizard-generator --dev`

2\. Register the provider in bootstrap/app.php

```
 if (InstalledVersions::isInstalled('macropay-solutions/php-kernel-dev')) {
    $app->register(\MacropaySolutions\CrufdWizardGenerator\CrufdWizardGeneratorServiceProvider::class);
}
```

Usage
-----

[](#usage)

` php run make:api-resource {resourceName} {--decorated} {--table=} {--connection=} {--composed} {--connectionAsModelFolder}`

This will create a template for **controller**, **service** and **model (with prepopulated columns from DB)** (optionally, with the **--decorated** flag it will create also a **decorator** and **middleware**) and will print instructions on what is left to be done manually.

If connection is not the default one, it can be specified in the command option.

If table is not the snake cased resourceName, then it can be specified in the table option. It is advised to have the table migrated in DB already.

Run just **php run make:api-resource** or **php run make:api-resource --decorated** for interactive mode that will try to guess the tableName and use default connectionName.

**--composed** flag will generate model and service for composed primary key

Example:

```
php run make:api-resource products --decorated
```

```
Created Model: /var/www/html/project/app/Models/Product.php
Created ModelAttributes: /var/www/html/project/app/Models/Attributes/ProductAttributes.php
Created Service: /var/www/html/project/app/Services/ProductsService.php
Created Controller: /var/www/html/project/app/Http/Controllers/ProductsController.php
Created Decorator: /var/www/html/project/app/Decorators/ProductDecorator.php
Created Middleware: /var/www/html/project/app/Http/Middleware/Decorators/ProductsMiddleware.php
---------------------------------------------------------------------------------------------
TODO:
- Fill the Model's properties and relations,
- Fill the ModelAttributes' dock-block property types,
- Fill the ModelRelations' dock-block property-reads,
- Define validations and DbCrudMap in Controller,
- Fill the Decorator,
- Register Middleware decorator as route middleware,
- Use the middleware alias as middleware in your crud route definition for each method.
- Expose resource in DbCrudMap::MODEL_FQN_TO_CONTROLLER_MAP.
---------------------------------------------------------------------------------------------
Thank you for using php-crufd-wizard-generator
For more details see: https://github.com/macropay-solutions/php-crufd-wizard-generator
For full cruFd suite: https://php-crufd-wizard.com

```

---

```
php run make:api-resource products-methods-pivot --composed
```

```
Created Model: /var/www/html/project/app/Models/ProductMethodPivot.php
Created ModelAttributes: /var/www/html/project/app/Models/Attributes/ProductMethodPivotAttributes.php
Created Service: /var/www/html/project/app/Services/ProductsMethodsPivotService.php
Created Controller: /var/www/html/project/app/Http/Controllers/ProductsMethodsPivotController.php
---------------------------------------------------------------------------------------------
TODO:
- Fill the Model's properties and relations,
- Fill the ModelAttributes' dock-block property types,
- Fill the ModelRelations' dock-block property-reads,
- Replace composed primary keys id_1, id_2, ... in Model and Service,
- Define validations and DbCrudMap in Controller,
- Expose resource in DbCrudMap::MODEL_FQN_TO_CONTROLLER_MAP.
---------------------------------------------------------------------------------------------
Thank you for using php-crufd-wizard-generator
For more details see: https://github.com/macropay-solutions/php-crufd-wizard-generator
For full cruFd suite: https://php-crufd-wizard.com

```

Note.

If errors appear for creating folders (from docker container for example), create the folders manually or use this command in your project to give permissions to docker container for creating the files: `sudo chown -R www-data:www-data app` and run again the command.

The required folder structure is:

[![img_1.png](img.png)](img.png)

If **--connectionAsModelFolder** flag is used, **--connection=** will be \\ucfirst and used as subfolder for Model and ModelAttributes.

If the command was already ran without the **--decorated** flag, it can be run again with it to generate the decorator and middleware.

License
-------

[](#license)

This package is licensed under the [license MIT](http://opensource.org/licenses/MIT).

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance92

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity26

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

Total

3

Last Release

40d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/153634237?v=4)[macropay-solutions](/maintainers/macropay-solutions)[@macropay-solutions](https://github.com/macropay-solutions)

---

Top Contributors

[![macropay-solutions](https://avatars.githubusercontent.com/u/153634237?v=4)](https://github.com/macropay-solutions "macropay-solutions (2 commits)")

---

Tags

restgeneratorcrudREST APIcrufd

### Embed Badge

![Health badge](/badges/macropay-solutions-php-crufd-wizard-generator/health.svg)

```
[![Health](https://phpackages.com/badges/macropay-solutions-php-crufd-wizard-generator/health.svg)](https://phpackages.com/packages/macropay-solutions-php-crufd-wizard-generator)
```

###  Alternatives

[mrdebug/crudgen

Create a Laravel Crud in a few seconds

31830.0k](/packages/mrdebug-crudgen)[cakedc/cakephp-api

Api plugin for CakePHP

61119.2k](/packages/cakedc-cakephp-api)[nvmcommunity/alchemist-restful-api

A library that helps you quickly get a rigorous and flexible RESTful-based API interface for your application.

591.1k2](/packages/nvmcommunity-alchemist-restful-api)[maurobonfietti/slim4-api-skeleton

Useful skeleton for RESTful API development, using PHP and Slim 4.

1392.4k](/packages/maurobonfietti-slim4-api-skeleton)[tomatophp/filament-api

Generate APIs from your filament resource using single line of code

537.4k1](/packages/tomatophp-filament-api)

PHPackages © 2026

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