Getting Started

Install Larahammer and scaffold your first CRUD application in minutes.

Requirements

Installation

Install the package via Composer:

bash
composer require larahammer/generator

The package will auto-register in Laravel 5.5+. If you're using an older version, add the service provider to config/app.php:

php
'providers' => [
    // ...
    Larahammer\Generator\GeneratorServiceProvider::class,
],

First CRUD

Generate a complete CRUD for a Product model:

bash
php artisan larahammer:make Product name:string price:decimal description:text

The command will prompt you to choose a target:

Run Migrations

Execute the generated migration to create the database table:

bash
php artisan migrate

Seed Data (Optional)

Populate the table with sample data:

bash
php artisan db:seed ProductSeeder

Access Your CRUD

Depending on your chosen target:

Blade Views

Filament Admin

Access at /admin/resources/products (requires Filament installation)

REST API

Configuration

Optionally publish the config file:

bash
php artisan vendor:publish --provider='Larahammer\\Generator\\GeneratorServiceProvider' --tag=config

Edit config/larahammer.php:

php
return [
    'default_target' => 'blade', // Change default target
    'force'          => false,    // Overwrite existing files by default
];

What's Next?