Skip to main content

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

  1. Orchestrator Command: make:module-crud
  • Purpose & Workflow
  • Command Signature
  • YAML Configuration (Single & Multi-File)
  1. 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)
  1. 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

The make: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-yml is used, this file contains all definitions (form, view, table, etc.).
  • If --single-yml is 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 any name defined in the YAML. If not provided, the command will prompt for it interactively.
  • --ns: (Optional) The module namespace (e.g., Inventory/Catalog). Overrides any namespace defined in the YAML. If not provided, the command will prompt for it interactively.
  • --single-yml: (Flag) Must be included if targetDefinitionFile is 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):
B) Multi-File (Orchestrator) Mode The main YAML file points to other specialized YAML files. Example (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

Perintah make: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-yml digunakan, file ini berisi semua definisi (form, view, table, dll.).
  • Jika --single-yml TIDAK digunakan, file ini adalah orkestrator yang menunjuk ke file YAML lainnya.
  • --name: (Opsional) Nama entitas (contoh: Product, SalesOrder). Menggantikan name yang didefinisikan di YAML. Jika tidak diberikan, perintah akan meminta secara interaktif.
  • --ns: (Opsional) Namespace modul (contoh: Inventory/Catalog). Menggantikan namespace yang didefinisikan di YAML. Jika tidak diberikan, perintah akan meminta secara interaktif.
  • --single-yml: (Flag) Harus disertakan jika targetDefinitionFile adalah 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):
B) Mode Multi-File (Orkestrator) File YAML utama menunjuk ke file YAML khusus lainnya. Contoh (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.)