AI-ready development
AI Coding with Laravolt
AI Coding with Laravolt
Laravolt v7 is designed for AI-assisted development. This quickstart shows AI agents and developers how to bootstrap a working admin module, verify it works, and customize it for production.
Prerequisites
Before starting, ensure:
- Laravel 11+ project with Laravolt v7 installed
- Database configured and migrated
php artisan serverunning- Access to
/llms.txtand/llms-full.txtfor context
Verify installation:
php artisan laravolt:modelsIf this command runs without errors, Laravolt is ready.
Quick bootstrap workflow
The fastest path from idea to working admin module:
1. Create the migration
php artisan make:migration create_products_tableDefine the schema:
Schema::create('products', function (Blueprint $table) { $table->id(); $table->string('name'); $table->string('sku')->unique(); $table->text('description')->nullable(); $table->decimal('price', 10, 2); $table->boolean('is_active')->default(true); $table->timestamps();});Run the migration:
php artisan migrate2. Generate the module with Thunderclap
php artisan laravolt:clap --table=products --module=ProductThis generates:
modules/Product/Controllers/ProductController.phpmodules/Product/Models/Product.php(or enhances existingapp/Models/Product.php)modules/Product/Requests/StoreProductRequest.phpmodules/Product/Requests/UpdateProductRequest.phpmodules/Product/resources/views/(index, create, edit, show, form)modules/Product/TableView.phpmodules/Product/routes/web.phpmodules/Product/config/config.phpmodules/Product/ServiceProvider.phpmodules/Product/Tests/Feature/ProductTest.php
3. Register the module
Add to config/app.php providers:
'providers' => [ // ... Modules\Product\ServiceProvider::class,],Or use auto-discovery if configured.
4. Verify routes
php artisan route:list --name=productExpected routes:
GET|HEAD product ..................... product.indexGET|HEAD product/create .............. product.createPOST product ..................... product.storeGET|HEAD product/{product} ........... product.showGET|HEAD product/{product}/edit ...... product.editPUT|PATCH product/{product} ........... product.updateDELETE product/{product} ........... product.destroy5. Run tests
php artisan test --filter=ProductTestGenerated tests verify:
- Index page loads
- Create form renders
- Store validation works
- Update validation works
6. Check the UI
Visit http://localhost:8000/product in your browser.
You should see:
- Empty product listing (Suitable table)
- "New product" button (if authorized)
- Search and sort controls
Click "New product" to test the create form.
Using /llms.txt for context
When prompting an AI agent, include the documentation context:
Read /llms.txt to understand Laravolt v7 conventions.Task: Add a "category" field to the Product module.- Add migration for products.category_id foreign key- Update StoreProductRequest and UpdateProductRequest validation- Add category select field to form view- Update ProductTable to show category name- Add feature test for category validationThe agent can fetch /llms-full.txt for complete API reference or use the "Copy Markdown" button on specific pages.
Common AI prompts
Generate a new CRUD module
Generate a Laravolt v7 CRUD module for "PurchaseOrder" table.Steps:1. Create migration with fields: order_number (string, unique), vendor_name (string), total_amount (decimal), status (enum: draft/submitted/approved/rejected), notes (text, nullable)2. Run migration3. Generate module: php artisan laravolt:clap --table=purchase_orders --module=PurchaseOrder4. Register ServiceProvider in config/app.php5. Verify routes: php artisan route:list --name=purchase-order6. Run tests: php artisan test --filter=PurchaseOrderTest7. Return: generated files list, test results, route listAdd validation rules
Update Product module validation:- name: required, max 255- sku: required, unique, max 50- price: required, numeric, min 0- description: nullable, max 1000Files to modify:- modules/Product/Requests/StoreProductRequest.php- modules/Product/Requests/UpdateProductRequest.phpReturn: updated validation rules, test commandCustomize the form
Customize Product form view:- Add help text under SKU field: "Use format: PROD-XXXX"- Make description field use textarea with 5 rows- Add price input mask: currency format- Group name and SKU in one row (2 columns)File: modules/Product/resources/views/form.blade.phpUse PrelineForm API. Return: updated form code.Add table columns
Update Product listing table:- Show: name, sku, price (formatted as currency), is_active (as badge), created_at- Make name, sku, price sortable- Add search on name and sku- Add row actions: view, edit, delete (with policy check)File: modules/Product/TableView.phpUse Suitable API. Return: updated table class.Expected file structure after generation
modules/Product/├── Controllers/│ └── ProductController.php # Resource controller├── Models/│ └── Product.php # Eloquent model (or uses app/Models/Product.php)├── Requests/│ ├── StoreProductRequest.php # Create validation│ └── UpdateProductRequest.php # Update validation├── resources/views/│ ├── index.blade.php # List page (renders TableView)│ ├── create.blade.php # Create form page│ ├── edit.blade.php # Edit form page│ ├── show.blade.php # Detail page│ └── form.blade.php # Shared form fields├── routes/│ └── web.php # Module routes├── config/│ └── config.php # Module configuration├── Tests/Feature/│ └── ProductTest.php # Feature tests├── ServiceProvider.php # Module service provider└── TableView.php # Suitable table classVerification commands
After any change, run these commands to verify:
# Check syntaxcomposer check-syntax# Run static analysiscomposer analyse# Format codecomposer format# Run testsphp artisan test# Check routesphp artisan route:list# Clear cachesphp artisan optimize:clearCommon pitfalls
1. Module not registered
Symptom: Routes don't appear, views not found
Fix: Add ServiceProvider to config/app.php or verify auto-discovery
2. Validation not working
Symptom: Form accepts invalid data
Fix: Check FormRequest rules, ensure controller uses StoreProductRequest / UpdateProductRequest
3. Table not showing data
Symptom: Empty listing even with database records
Fix: Check TableView source query, verify model namespace, check permissions
4. Tests failing
Symptom: Generated tests fail
Fix: Run migrations in test environment, check phpunit.xml database config
What to read next
- Thunderclap recipes — post-generation customization patterns
- AI task patterns — prompt templates for common tasks
- Forms overview — PrelineForm API reference
- Tables and listings — Suitable API reference
- AI-ready development guide — broader AI coding principles