Download the PHP package artisanalbyte/vilt-crud-generator without Composer
On this page you can find all versions of the php package artisanalbyte/vilt-crud-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download artisanalbyte/vilt-crud-generator
More information about artisanalbyte/vilt-crud-generator
Files in artisanalbyte/vilt-crud-generator
Package vilt-crud-generator
Short Description Laravel Inertia CRUD Generator Package
License
Informations about the package vilt-crud-generator
VILT CRUD Generator for Laravel
Generate beautiful, robust, and fully customizable CRUD scaffolding for your VueJS + Inertia + Laravel + Tailwind (VILT) stack in seconds.
✨ Features
- One-Command CRUD: Instantly generate Model, Controller, FormRequest, Resource, and Inertia Vue pages (TypeScript or JavaScript) for any table/model.
- Editable Stubs: All PHP and Vue stubs are fully publishable and editable. Tweak the generated code and design to fit your project's style and requirements.
- TypeScript or JavaScript: Choose between TypeScript or plain JavaScript for your Vue pages.
- FormRequest & Validation: Generate FormRequest classes for robust validation, or keep validation inline in controllers.
- Resource & Collection: Optionally generate API Resource and ResourceCollection classes for clean API responses.
- Smart Schema Introspection: Reads your database schema to auto-generate fields, validation, and Vue form components.
- Configurable & Extensible: Publish config and stubs, map DB types to custom Vue components, and control every aspect of the generated code.
- Modern UI: Vue pages use a clean, modern layout and leverage your own UI components.
- Safe by Default: System and sensitive columns (timestamps, soft deletes, passwords, tokens, etc.) are excluded from forms and fillables.
- Multi-Model Support: Generate scaffolding for multiple models/tables in a single command.
- Out-of-the-box for Laravel Vue Starter Kit: Designed to work seamlessly with the Laravel Vue Starter Kit, using its default layouts and UI components.
- Flash Message Support: All generated pages display success/error flash messages using Inertia's shared props.
- TypeScript Types for Inertia: Publishes a
resources/js/types/inertia.d.ts
file for improved TypeScript support. - Advanced DB Type Mapping: The config supports mapping a wide range of DB column types (MySQL, PostgreSQL, SQLite) to custom Vue components.
- Automatic Route Insertion: Resource routes are automatically inserted into your routes file, inside a protected block.
- Support for Separate or Single FormRequest Files: Can generate either separate Store/Update FormRequest files or a single file, based on config or CLI options (single file by default).
- Improved Error Handling: Controller stubs include error catching and flash error messages for create, update, and delete actions.
- Consistent Use of Custom UI Components: All generated pages use custom BackButton, NumberInput, DateInput, and Button components.
- Modern, Maintainable Vue Pages: All Vue pages use
<script setup>
and a clean, modern layout. - Interactive & Non-Interactive CLI: The generator command can be run interactively (with prompts for model/table, options, etc.) or non-interactively by passing arguments and flags directly.
🚀 Quick Start
-
Install via Composer:
-
Publish Config, Stubs, and UI Components:
- Generate CRUD for a Model (Interactive):
This will launch an interactive prompt to select the model/table and options.
-
Generate CRUD for a Model (Non-Interactive):
-
Generate for Multiple Models:
- Options:
--form-request
: Generate FormRequest classes for validation--resource-collection
: Generate Resource & Collection classes--no-ts
: Generate Vue pages in JavaScript instead of TypeScript--force
: Overwrite existing files--single-form-request
: Generate a single FormRequest file for both store and update actions (default if neither flag is provided)--separate-form-request
: Generate separate FormRequest files for store and update actions (useful if you want different validation rules for each)
Usage:
- By default, the generator creates a single FormRequest file for both store and update actions.
- Use
--separate-form-request
if you want to generate two files: one for store and one for update, allowing you to customize validation rules for each action. - Use
--single-form-request
to explicitly generate only one FormRequest file for both actions.
📦 Publishable Assets & File Tree
You can publish only what you need, or everything at once:
Command | What it Publishes |
---|---|
php artisan vilt-crud:publish --all |
Config, stubs, UI components, TS |
php artisan vilt-crud:publish |
Config, UI components, TS |
php artisan vilt-crud:publish --stubs |
Stubs only |
Published File Tree Example:
🛠️ Customization & Flexibility
1. Editable Stubs
All generated code is based on stub templates. You can publish and edit these stubs:
Edit the published stubs in resources/stubs/vilt-crud-generator/
to:
- Change controller logic
- Adjust model fillables, casts, or relationships
- Redesign Vue pages (layout, fields, UI components)
- Add or remove validation rules
Every time you run the generator, your custom stubs are used!
2. Configurable UI & Field Mapping
- Map DB column types to your own Vue components in
config/vilt-crud-generator.php
. - Exclude system columns, sensitive columns, tweak default behaviors, and more.
System Columns
- Defined in
systemColumns
(e.g.created_at
,updated_at
,deleted_at
). - Excluded from forms and fillables by default.
Sensitive Columns
- Defined in
sensitiveColumns
(e.g.password
,token
,api_key
,secret
, etc.). - Excluded from forms to protect sensitive data.
3. Modern, Maintainable Code
- Clean, PSR-4 autoloaded PHP code
- Vue pages use
<script setup>
and your preferred UI kit - All generated code is readable, idiomatic, and ready for production
4. Default UI Components
This package provides three custom Vue components out of the box:
BackButton.vue
(navigation)NumberInput.vue
(numeric input)DateInput.vue
(date input)
All other layouts and components used are the defaults from the Laravel Vue Starter Kit.
📚 Example: Generating a CRUD for Post
This will generate:
app/Models/Post.php
app/Http/Controllers/PostController.php
app/Http/Requests/PostStoreRequest.php
,PostUpdateRequest.php
app/Http/Resources/PostResource.php
,PostCollection.php
resources/js/Pages/Posts/Index.vue
,Create.vue
,Edit.vue
,Show.vue
All files are based on your published stubs and config.
🧩 How It Works
- Schema Introspection: Reads your DB schema to generate fields, validation, and UI components.
- Stub Rendering: All code is generated from stubs, which you can edit and re-use.
- Smart Defaults: Sensible defaults for fillable, hidden, casts, and relationships.
- Safe Overwrites: Use
--force
to overwrite existing files.
🤖 Disclaimer
This package was made with the assistance of AI, but is not "Vibe Coded" by any means. All code is reviewed, tested, and maintained by a human developer.
💡 Personal Note & Vision
"I built this package for myself because I found writing CRUD boilerplate to be boring and not the best use of my time. Using AI to generate boilerplate required more than a few steps, and the results were often inconsistent with my project's style. With this package, I can get the boilerplate out of the way instantly and get straight to building the parts of my application that matter. My vision is to empower developers to focus on creativity and problem-solving, not repetitive code. I hope this tool saves you as much time and tedium as it has saved me. Happy building!"
📄 License
MIT © 2025 artisanalbyte
All versions of vilt-crud-generator with dependencies
laravel/framework Version ^12.0
inertiajs/inertia-laravel Version ^0.6|^2.0
doctrine/dbal Version ^4.0