Features & Examples
Larahammer provides three implementation phases with 13 different options to suit your needs.
Core Features (Always Generated)
Database Migration
Auto-generated migration from your field definitions.
Schema::create('products', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->decimal('price', 8, 2);
$table->text('description');
$table->timestamps();
});Eloquent Model
Full model with casts and relationships.
class Product extends Model
{
use HasFactory;
protected $fillable = ['name', 'price', 'description'];
protected $casts = [
'price' => 'decimal:2',
];
}Form Request
Built-in validation rules.
class StoreProductRequest extends FormRequest
{
public function rules(): array
{
return [
'name' => 'required|string|max:255',
'price' => 'required|numeric|min:0',
'description' => 'required|string',
];
}
}Database Seeder
Auto-populate data for testing.
class ProductSeeder extends Seeder
{
public function run(): void
{
Product::factory(50)->create();
}
}Phase 1: UI Targets
Choose your presentation layer:
Blade Views
php artisan larahammer:make Product name:string price:decimal --target=bladeGenerates: Controller, views (index, create, edit, show), and routes. Perfect for traditional Laravel apps.
Filament Admin Panel
php artisan larahammer:make Product name:string price:decimal --target=filamentGenerates: Filament resource with forms, tables, and actions. Modern admin panel out of the box.
REST API
php artisan larahammer:make Product name:string price:decimal --target=apiGenerates: API controller, JSON resources, and routes. Perfect for decoupled frontends.
All Targets
php artisan larahammer:make Product name:string price:decimal --target=allGenerates all three targets simultaneously. Supports Blade, Filament, and API in one project.
Phase 2: Advanced Features
Role-Based Access Control
php artisan larahammer:make Product --with-rolesIncludes role system, user relationships, and helper methods.
Landing Page
php artisan larahammer:make Product --with-landingTailwind-styled landing page with hero, features, and CTA sections.
Security Middleware
php artisan larahammer:make Product --with-security-middlewareCheckRole and AdminPanelProtection middleware for RBAC.
Admin Panel
php artisan larahammer:make Product --with-adminComplete Filament admin panel with dashboard and resources.
Phase 3: Production Features
Model Factories
php artisan larahammer:make Product --with-factoriesFaker-powered factories for testing with realistic data.
Soft Deletes
php artisan larahammer:make Product --with-soft-deletesSoft delete support with restore functionality.
Authorization Policies
php artisan larahammer:make Product --with-policiesAuthorization policies for view, create, update, delete actions.
API Authentication
php artisan larahammer:make Product --with-api-authSanctum-based API authentication with middleware.
Testing Suite
php artisan larahammer:make Product --with-testsFeature and unit tests covering all CRUD operations.
Activity Logging
php artisan larahammer:make Product --with-audit-logObserver-based activity logging for audit trails.
The Ultimate Command
Generate everything with a single command:
php artisan larahammer:make Product name:string price:decimal description:text --allThe --all flag generates all 3 targets + all 12 advanced features. Perfect for starting a new project.