Builder

/laravel-agent:feature:make

Create a complete Laravel feature with CRUD, views, API, migrations, and tests

Overview

The /feature:make command creates a complete, production-ready feature in your Laravel application. Unlike /build which delegates to the architect, this command directly invokes the laravel-feature-builder agent to generate all necessary components.

Usage

/laravel-agent:feature:make [feature name] [description]

Examples

# Create an invoice management feature
/laravel-agent:feature:make Invoices with line items, PDF export, and payment tracking

# Create a product catalog
/laravel-agent:feature:make Products with categories, variants, and inventory management

# Create user notifications
/laravel-agent:feature:make Notifications with email and in-app delivery

What Gets Created

A complete feature includes the following components:

Component Location Description
Model app/Models/ Eloquent model with relationships and scopes
Migration database/migrations/ Database schema with indexes
Controller app/Http/Controllers/ CRUD operations with validation
Form Request app/Http/Requests/ Validation rules for create/update
Resource app/Http/Resources/ API resource transformers
Views resources/views/ Blade templates (index, create, edit, show)
Routes routes/web.php Resource routes with middleware
Factory database/factories/ Model factory for testing
Tests tests/Feature/ Pest PHP feature tests

Options

You can customize what gets generated by including these in your description:

  • with API - Include API endpoints in routes/api.php
  • with soft deletes - Add soft delete support
  • with tenancy - Add tenant isolation for multi-tenant apps
  • without views - Skip Blade template generation
  • without tests - Skip test generation (not recommended)

Example Output Structure

For /laravel-agent:feature:make Invoices with line items and PDF export:

app/
├── Models/
│   ├── Invoice.php
│   └── InvoiceLineItem.php
├── Http/
│   ├── Controllers/
│   │   └── InvoiceController.php
│   ├── Requests/
│   │   ├── StoreInvoiceRequest.php
│   │   └── UpdateInvoiceRequest.php
│   └── Resources/
│       └── InvoiceResource.php
├── Services/
│   └── InvoicePdfService.php
database/
├── migrations/
│   ├── create_invoices_table.php
│   └── create_invoice_line_items_table.php
└── factories/
    └── InvoiceFactory.php
resources/views/invoices/
├── index.blade.php
├── create.blade.php
├── edit.blade.php
└── show.blade.php
tests/Feature/
└── InvoiceTest.php

Best Practices

  1. Be specific - Describe relationships and special behaviors in detail
  2. Mention integrations - If you need PDF, email, or external API integration, include it
  3. Consider authorization - Specify who should access what (e.g., "only admins can delete")
  4. Review before running migrations - Always check generated migrations before running them

Related Agent

This command uses the laravel-feature-builder agent.

See Also