PHPackages                             codebider/generate-crud - 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. [CLI &amp; Console](/categories/cli)
4. /
5. codebider/generate-crud

ActiveLibrary[CLI &amp; Console](/categories/cli)

codebider/generate-crud
=======================

An artisan command to automate the migration,model,resource controller, views and routes

v0.0.5(11mo ago)131341MITPHPPHP &gt;=7.3

Since Jan 8Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/AwaisJ670/laravel-crud-bot)[ Packagist](https://packagist.org/packages/codebider/generate-crud)[ RSS](/packages/codebider-generate-crud/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

[![Laravel Crud Generator](https://camo.githubusercontent.com/a3cc168144b8341267ab99b65aa028dc99e162ffec97a014b742ea8872d3ce3f/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4175746f6d617465642532304372756425323047656e65726174696f6e253230546f6f6c2e706e673f7468656d653d6461726b267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d636f6465626964657225324667656e65726174652d63727564267061747465726e3d7a69675a6167267374796c653d7374796c655f31266465736372697074696f6e3d49742b6175746f6d6174652b7468652b70726f636573732b6f662b726570657469746976652b7461736b2b666f722b6372656174696e672b637275642e266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d3735707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)](https://camo.githubusercontent.com/a3cc168144b8341267ab99b65aa028dc99e162ffec97a014b742ea8872d3ce3f/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4175746f6d617465642532304372756425323047656e65726174696f6e253230546f6f6c2e706e673f7468656d653d6461726b267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d636f6465626964657225324667656e65726174652d63727564267061747465726e3d7a69675a6167267374796c653d7374796c655f31266465736372697074696f6e3d49742b6175746f6d6174652b7468652b70726f636573732b6f662b726570657469746976652b7461736b2b666f722b6372656174696e672b637275642e266d643d312673686f7757617465726d61726b3d3026666f6e7453697a653d3735707826696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)

[![Packagist Downloads](https://camo.githubusercontent.com/42ff19c555264e440291c28e98daa4641805e2c493be702a2c7c6a6c9d6b16ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f646562696465722f67656e65726174652d63727564)](https://camo.githubusercontent.com/42ff19c555264e440291c28e98daa4641805e2c493be702a2c7c6a6c9d6b16ff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f646562696465722f67656e65726174652d63727564)[![Packagist Version](https://camo.githubusercontent.com/8e666a566e786a1bc59bb4921855a802ec96bca5f98fd55699c6a67c20de362e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f646562696465722f67656e65726174652d63727564)](https://camo.githubusercontent.com/8e666a566e786a1bc59bb4921855a802ec96bca5f98fd55699c6a67c20de362e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f646562696465722f67656e65726174652d63727564)

This Laravel CRUD Generator package provides and generates Controller, Model (with eloquent relations), Migration, Routes and Views for developing your applications with a single command.

Features
--------

[](#features)

1. Automatically generates files in the proper directory structure:

    - **Migration**
    - **Model**
    - **Controller**
    - **Views**
    - **Routes**
2. Interactive prompts for input:

    - Asks for the **model name** (e.g., `Product`, `User`).
    - Collects **field names**, their data types, and whether they are nullable or not.
    - Allows you to add relationships in the model.
3. Provides options for:

    - Previewing the generated migration file before saving.
    - Editing the migration file directly in the system's editor specified in the configuration file.
4. Automatically propagates updates:

    - If you edit fields in the migration file, these changes will also be applied to dependent components like the `$fillable` property in models.
5. Controller creation:

    - Choose between generating a **basic controller** or a **resource controller**.
6. Route creation:

    - Choose to generate routes in either `web.php` or `api.php`.
7. View file generation:

    - Choose to generate blade file or not.

Requirements
------------

[](#requirements)

```
Laravel >= 8.x
PHP >= 7.4

```

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

[](#installation)

1 - Install

```
composer require codebider/generate-crud

```

2- Publish the default package's config

```
php artisan vendor:publish --tag=crud-generator-config

```

Usage with Workflow
-------------------

[](#usage-with-workflow)

This tool can create the files by typing the command

```
    php artisan generate:crud

```

1. **Model Name:**

    - Enter the desired model name (e.g., `Product`, `Category`). Follow Laravel's naming conventions (singular and CamelCase). ```
            Enter the model name:

        ```
2. **Field Names and Types:**

    - Input field names along with their data types and whether they are nullable. Use the following format: ```
           Enter field name (or press enter to stop adding fields):

        ```

        Example: ```
           Enter field name (or press enter to stop adding fields):
           > name
           Select field type by default (string):
           [0 ] string
           [1 ] text
           [2 ] longText
           [3 ] integer
           [4 ] unsignedIn
           [5 ] bigInteger
           [6 ] unsignedBi
           [7 ] json
           [8 ] jsonb
           [9 ] enum
           [10] decimal
           [11] float
           [12] ipAddress
           [13] boolean
           [14] date
           [15] datetime
           [16] timestamp
           > 0
           Nullable  [Yes]:
           [0] Yes
           [1] No
           > 0

        ```
    - Press **Enter** without typing anything to end the field input process. ```
            Enter field name (or press enter to stop adding fields):
            >
            Creating Migration File
            Updating Migration File
            fields are : name

        ```
3. **Preview Migration File:**

    - Once all fields are entered, preview the migration file to verify its contents. ```
            Do you want to review the migration file before proceeding? (yes/no) [yes]:
            > yes
            Opening migration file: G:\laragon\www\Expense\database\migrations/Api/2024_12_29_105049_create_products_table.php

        ```
4. **Edit Migration File:**

    - Preview migration in the specified operating system in the config file e.g(`config/crud_generator.php`).
5. **Propagating Changes:**

    - Any changes made to the migration file will automatically update other components where fields are required (e.g., `$fillable` in models). ```
            Is the migration file correct? (yes/no) [yes]:
            > yes
            Migration file is correct.
            Migrated Successfully.
            Creating Model

        ```
6. **Adding Relationships:**

    - Add relationships (e.g., one-to-one, one-to-many, many-to-many) to the model by following the interactive prompts. ```
            Do you want to add relationships to this model? [No]:
            [0] Yes
            [1] No
            > 0

        ```
7. **Creating a Controller:**

    - Choose to create a controller ```
            Do you want to generate Controller? [Yes]:
            [0] Yes
            [1] No
            >

        ```
    - Choose between a **basic controller** (minimal functionality) or a **resource controller** (includes all RESTful methods). ```
            Do you want to create a resource controller or a basic controller? [resource]:
            [0] resource
            [1] basic
            >

        ```
    - After Selection ```
            Resource controller created successfully at G:\laragon\www\Expense\app\Http\Controllers\Api\ProductController.php

        ```
8. **Generating Routes:**

    - Select whether the routes should be added to `web.php` or `api.php` based on your application requirements. ```
            Where do you want to add routes? [web.php]:
            [0] api.php
            [1] web.php
            >

        ```
    - After Selection ```
            Generating web routes...
            Added route to G:\laragon\www\Expense\routes/web.php

        ```
9. **Creating View Files:**

    - Choose to create a view file ```
            Do you want to generate views? [Yes]:
            [0] Yes
            [1] No
            >

        ```
    - After Selection ```
            Generating views...
            Created view file: G:\laragon\www\Expense\resources\views\Api\products/index.blade.php

        ```
10. Successfully created the crud

    - After completion of all the steps, you will see a success message indicating that the CRUD operation ```
            Migration and cache cleared successfully!
            CRUD files for Product generated successfully!
            Log sent to server successfully.

        ```

Contributing
------------

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Author
------

[](#author)

Awais Javaid [Email Me](mailto:info.awaisjavaid@gmail.com)

Hire Me [LinkedIn](https://www.linkedin.com/in/malikawaisjavaid/)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance50

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity27

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

Total

5

Last Release

352d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/096a0cf49d16f3f6ec00913feb8934547c0bd379870ea61b0b6fe41f86a35439?d=identicon)[awaisJavaid](/maintainers/awaisJavaid)

---

Top Contributors

[![AwaisJ670](https://avatars.githubusercontent.com/u/143515006?v=4)](https://github.com/AwaisJ670 "AwaisJ670 (33 commits)")

---

Tags

add-routes-in-routes-fileartisanconsolecreate-controllercreate-migrationcreate-modellaravellaravel-packagephplaravellaravel-packagecrudcrud generatorlaravel crud generatorcrud bot

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codebider-generate-crud/health.svg)

```
[![Health](https://phpackages.com/badges/codebider-generate-crud/health.svg)](https://phpackages.com/packages/codebider-generate-crud)
```

###  Alternatives

[ibex/crud-generator

Laravel CRUD Generator

706235.0k](/packages/ibex-crud-generator)[mrdebug/crudgen

Create a Laravel Crud in a few seconds

31826.8k](/packages/mrdebug-crudgen)[takielias/tablar-crud-generator

Laravel Tablar Crud Generator based on https://github.com/takielias/tablar

315.6k](/packages/takielias-tablar-crud-generator)[andreacivita/api-crud-generator

Simple API Crud generator for Laravel

131.2k](/packages/andreacivita-api-crud-generator)

PHPackages © 2026

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