API Reference
Complete documentation of the larahammer:make command and all available options.
Command Syntax
php artisan larahammer:make {name} {fields*} [options]Arguments
name
Model name in StudlyCase (e.g., Product, BlogPost, UserProfile)
php artisan larahammer:make Productfields*
Field definitions for the migration. Multiple fields supported.
php artisan larahammer:make Product name:string price:decimal status:enum(active,inactive)Supported types: string, text, integer, boolean, date, datetime, decimal, enum, json, longText, mediumText, uuid, and more.
Target Options
Choose your UI presentation layer (required — prompted if omitted):
--target=blade
Blade views + controller + routes
php artisan larahammer:make Product name:string --target=blade--target=filament
Filament admin resource + routes
php artisan larahammer:make Product name:string --target=filament--target=api
REST API controller + JSON resource
php artisan larahammer:make Product name:string --target=api--target=all
Blade + Filament + API
php artisan larahammer:make Product name:string --target=allFeature Flags
Phase 1: Role System & UI Enhancements
Generate role-based access control system with migration, model, and seeder.
Generate Tailwind-styled landing page.
Generate complete Filament admin panel.
Generate CheckRole and AdminPanelProtection middleware.
Phase 2: Testing & Advanced Features
Generate model factory with Faker data.
Add soft delete support to model and migration.
Generate authorization policy class for all actions.
Generate API authentication with Sanctum middleware.
Generate feature and unit tests for all CRUD operations.
Generate activity logging with observer pattern.
Convenience & Utility
Generate everything: all targets + all advanced features
Equivalent to: --target=all --with-roles --with-admin --with-landing --with-security-middleware --with-factories --with-soft-deletes --with-policies --with-api-auth --with-tests --with-audit-log
Overwrite existing files without confirmation.
Examples
Simple CRUD with Blade Views
php artisan larahammer:make Post title:string slug:string content:text --target=bladeAdmin Panel with Filament
php artisan larahammer:make BlogCategory name:string description:text --target=filamentREST API with Authentication
php artisan larahammer:make Article title:string content:text --target=api --with-api-authComplete Application
php artisan larahammer:make Order order_number:string total:decimal status:enum(pending,processing,completed,cancelled) --allCombination of Specific Features
php artisan larahammer:make Product name:string price:decimal --target=all --with-factories --with-tests --with-policiesTip: You can combine any target with any combination of feature flags. Only the features you request will be generated.
Generated File Structure
When you run php artisan larahammer:make Product --all, you'll get:
app/
├── Models/
│ └── Product.php
├── Http/
│ ├── Controllers/
│ │ ├── ProductController.php (Blade)
│ │ └── Api/ProductController.php (API)
│ ├── Requests/
│ │ ├── StoreProductRequest.php
│ │ └── UpdateProductRequest.php
│ └── Resources/
│ └── ProductResource.php
├── Filament/
│ ├── Resources/
│ │ └── ProductResource.php
│ └── Pages/
│ ├── CreateProduct.php
│ └── EditProduct.php
├── Observers/
│ └── ProductObserver.php
├── Policies/
│ └── ProductPolicy.php
└── Models/Role.php, Activity.php (if applicable)
database/
├── migrations/
│ ├── create_products_table.php
│ └── (other migrations)
├── factories/
│ └── ProductFactory.php
└── seeders/
├── ProductSeeder.php
└── RoleSeeder.php
routes/
├── web.php (Blade routes)
└── api.php (API routes)
resources/
└── views/
└── products/
├── index.blade.php
├── create.blade.php
├── edit.blade.php
└── show.blade.php
tests/
├── Feature/
│ └── ProductTest.php
└── Unit/
└── ProductTest.php