CRUD Generator Commands Documentation
This document outlines the usage of a suite of Artisan commands designed to rapidly scaffold complete CRUD (Create, Read, Update, Delete) modules within a Laravel Inertia.js application using Vue 3, TypeScript, and shadcn-vue. The system is orchestrated by a main command,make:module-crud, which in turn calls specialized sub-generator commands.
Table of Contents
- Orchestrator Command:
make:module-crud
- Purpose & Workflow
- Command Signature
- YAML Configuration (Single & Multi-File)
- Sub-Generator Commands
make:inertia-crud(Controller, Model, Index Page)make:vue-form(Form Component, Create/Edit Pages)make:vue-dataview(Data View Component, View Page)make:table-columns(TanStack Table Columns)make:zod-schema(Zod Schema & TypeScript Type)
- YAML Field Reference
- Form & Data View Field Properties
- Layout Section Properties
- Chart, Map, and other Complex Component Parameters
1. Orchestrator Command: make:module-crud
This is the primary command used to generate a full CRUD module from a single YAML configuration.
Purpose & Workflow
Themake:module-crud command reads a central YAML file that defines all aspects of a CRUD entity. Based on this configuration, it intelligently calls the other specialized generator commands (make:inertia-crud, make:vue-form, etc.) to create all the necessary PHP and Vue/TypeScript files. This provides a single-command workflow for scaffolding new features.
Command Signature
targetDefinitionFile: The path to the main YAML file.- If
--single-ymlis used, this file contains all definitions (form,view,table, etc.). - If
--single-ymlis NOT used, this file is an orchestrator that points to other YAML files. --name: (Optional) The name of the entity (e.g.,Product,SalesOrder). Overrides anynamedefined in the YAML. If not provided, the command will prompt for it interactively.--ns: (Optional) The module namespace (e.g.,Inventory/Catalog). Overrides anynamespacedefined in the YAML. If not provided, the command will prompt for it interactively.--single-yml: (Flag) Must be included iftargetDefinitionFileis a single, comprehensive YAML file.--force: (Flag) Overwrites existing files without prompting.--skip-format: (Flag) Skips running Prettier (for JS/TS/Vue) and Pint (for PHP) on the generated files.
YAML Configuration
A) Single-File Mode (--single-yml)
A single YAML file contains multiple top-level keys (module_info, form, view, table, etc.).
Example (product_module.yml):
product_orchestrator.yml):
1. Perintah Orkestrator: make:module-crud (Bahasa Indonesia)
Ini adalah perintah utama yang digunakan untuk menghasilkan modul CRUD lengkap dari satu file konfigurasi YAML.
Tujuan & Alur Kerja
Perintahmake:module-crud membaca file YAML pusat yang mendefinisikan semua aspek dari sebuah entitas CRUD. Berdasarkan konfigurasi ini, ia secara cerdas memanggil perintah generator khusus lainnya (make:inertia-crud, make:vue-form, dll.) untuk membuat semua file PHP dan Vue/TypeScript yang diperlukan. Ini menyediakan alur kerja satu-perintah untuk membangun fitur baru.
Struktur Perintah
targetDefinitionFile: Path ke file YAML utama.- Jika
--single-ymldigunakan, file ini berisi semua definisi (form,view,table, dll.). - Jika
--single-ymlTIDAK digunakan, file ini adalah orkestrator yang menunjuk ke file YAML lainnya. --name: (Opsional) Nama entitas (contoh:Product,SalesOrder). Menggantikannameyang didefinisikan di YAML. Jika tidak diberikan, perintah akan meminta secara interaktif.--ns: (Opsional) Namespace modul (contoh:Inventory/Catalog). Menggantikannamespaceyang didefinisikan di YAML. Jika tidak diberikan, perintah akan meminta secara interaktif.--single-yml: (Flag) Harus disertakan jikatargetDefinitionFileadalah file YAML tunggal yang komprehensif.--force: (Flag) Menimpa file yang sudah ada tanpa meminta konfirmasi.--skip-format: (Flag) Melewatkan proses format kode dengan Prettier (untuk JS/TS/Vue) dan Pint (untuk PHP).
Konfigurasi YAML
A) Mode File Tunggal (--single-yml)
Satu file YAML berisi beberapa kunci tingkat atas (module_info, form, view, table, dll.).
Contoh (product_module.yml):
product_orchestrator.yml):
(The documentation for the sub-generators and YAML field reference would follow in a similar bilingual format. Due to the length, I’ll provide them if you ask for the next part.)
