sakshi-chavan/laravel-crud-generator

A reusable Laravel package to generate CRUD from a JSON template

Maintainers

Package info

github.com/SakshiChavan13/Laravel-crud-generator

Language:Blade

pkg:composer/sakshi-chavan/laravel-crud-generator

Statistics

Installs: 38

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

v1.0.3 2025-12-07 15:51 UTC

This package is not auto-updated.

Last update: 2026-03-30 12:07:02 UTC


README

A simple and customizable Laravel package to generate CRUD operations from a JSON template.

🛠️ Installation

Step 1: Require the package

Run:

composer require sakshi-chavan/laravel-crud-generator

Step 2: Generate CRUD template

Run:

php artisan make:crud-template {jsonFileName}

Step 3: Edit the generated template

E.g Post.json template

{
    "model": "Post",
    "fields": [
        {
            "name": "title",
            "type": "string",
            "nullable":false
        },
        {
            "name": "content",
            "type": "text",
            "nullable": false
        },
        {
            "name": "user_id",
            "type": "integer",
            "nullable": false
        },
        {
            "name": "owner_id",
            "type": "integer",
            "nullable": false
        },

        {
            "name": "is_restricted",
            "type": "boolean",
            "nullable": false,
            "default": 1
        }
    ]
}

Step 4: Generate CRUD Command

Run:

php artisan generate:crud {jsonFileName}

🧩 What It Does

This package allows you to automatically generate full CRUD functionality in Laravel using a single JSON template.

Currently Supports:

  • ✅ Model generation
  • ✅ Migration generation
  • ✅ Form Request classes
  • ✅ Route entries
  • ✅ Controller with CRUD logic
  • ✅ Resource generation
  • ✅ Factory generation
  • ✅ Basic Crud Test cases generation(PEST)

⚠️ Note: All files and respective code are generated based on stub templates.

Imports for related models (like relationships) may not always be accurate.
Please review and adjust them after generation.