amirulislam/laravel-simplify-crud

A powerful Laravel CRUD generator — generates Model, Migration, Controller, Request, Routes and Views from a single artisan command.

Maintainers

Package info

github.com/Amir-16/laravel-simplify-crud

pkg:composer/amirulislam/laravel-simplify-crud

Transparency log

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-07-23 10:23 UTC

This package is auto-updated.

Last update: 2026-08-23 10:42:14 UTC


README

Latest Version on Packagist Total Downloads PHP Version Laravel License: MIT

Generate a complete CRUD scaffold from a single artisan command.

One command creates your Model, Migration, Controller, Form Requests, Routes, and Blade Views — all properly named, humanized, and wired together.

php artisan simplify:crud ProductCategory --fields="name:string,price:decimal,is_active:boolean"

What Gets Generated

Running the command above produces:

app/Models/ProductCategory.php
app/Http/Controllers/ProductCategoryController.php
app/Http/Requests/StoreProductCategoryRequest.php
app/Http/Requests/UpdateProductCategoryRequest.php
database/migrations/2026_01_01_000000_create_product_categories_table.php
routes/web.php  ← Route::resource appended
resources/views/product-categories/index.blade.php
resources/views/product-categories/create.blade.php
resources/views/product-categories/edit.blade.php
resources/views/product-categories/show.blade.php

Then just run:

php artisan migrate

And visit /product-categories in your browser.

Requirements

  • PHP 8.2+
  • Laravel 10, 11, or 12

Installation

composer require amirulislam/laravel-simplify-crud

Laravel auto-discovers the package. No manual registration needed.

Basic Usage

# Minimal — just a model name
php artisan simplify:crud Post

# With fields
php artisan simplify:crud Post --fields="title:string,body:text,published_at:datetime:nullable"

# API only (no Blade views)
php artisan simplify:crud Post --fields="title:string,body:text" --api

# With soft deletes
php artisan simplify:crud Post --fields="title:string" --soft-deletes

# Overwrite existing files
php artisan simplify:crud Post --fields="title:string" --force

Field Definition Format

Fields are comma-separated. Each field follows this pattern:

name:type
name:type:nullable
name:type:unsigned
name:type:nullable:unsigned
name:decimal:precision:scale
name:enum:value1:value2:value3

Examples

--fields="title:string"
--fields="title:string,body:text:nullable,price:decimal:10:2,is_active:boolean"
--fields="status:enum:draft:published:archived"
--fields="avatar:image:nullable"
--fields="views:integer:unsigned"

Supported Field Types

Type Migration Column Validation Input
string string() string|max:255 text
text text() string textarea
longtext longText() string textarea
integer integer() integer number
bigint bigInteger() integer number
smallint smallInteger() integer number
decimal decimal(8, 2) numeric number
float float() numeric number
double double() numeric number
boolean boolean() boolean checkbox
date date() date date
datetime dateTime() date datetime-local
time time() date_format:H:i time
json json() array textarea
enum enum([...]) string|in:... select
uuid uuid() uuid text
file string() file|max:2048 file
image string() image|max:2048 file

Available Options

Option Description
--fields= Comma-separated field definitions
--api Generate API controller and routes only — no Blade views
--soft-deletes Add SoftDeletes to model and softDeletes() to migration
--force Overwrite existing files

Naming — Humanized Automatically

Give the model name in any common format. The package handles the rest.

Input Accepted
ProductCategory ✓ StudlyCase
product_category ✓ snake_case
productcategory ✓ lowercase

Everything is derived correctly:

Usage Value
Class name ProductCategory
Table name product_categories
Route prefix product-categories
View folder product-categories
Page heading Product Categories
Field labels Product Category
Variable name $productCategory

View Themes

Blade views are generated for Tailwind CSS (default) or Bootstrap 5.

Change the theme in config:

// config/simplify-crud.php
'view_theme' => 'tailwind',  // or 'bootstrap'

Or set it per-environment:

SIMPLIFY_CRUD_THEME=bootstrap

Configuration

Publish the config file to customise paths, namespaces, and defaults:

php artisan vendor:publish --tag=simplify-crud-config
// config/simplify-crud.php

return [
    'paths' => [
        'model'      => app_path('Models'),
        'controller' => app_path('Http/Controllers'),
        'request'    => app_path('Http/Requests'),
        'migration'  => database_path('migrations'),
        'views'      => resource_path('views'),
        'routes'     => base_path('routes/web.php'),
        'api_routes' => base_path('routes/api.php'),
    ],

    'namespaces' => [
        'model'      => 'App\\Models',
        'controller' => 'App\\Http\\Controllers',
        'request'    => 'App\\Http\\Requests',
    ],

    'view_theme'  => env('SIMPLIFY_CRUD_THEME', 'tailwind'),
    'timestamps'  => true,
    'soft_deletes' => false,
];

Customising Stubs

Publish the stubs to your project and edit them freely:

php artisan vendor:publish --tag=simplify-crud-stubs

Stubs are placed in stubs/simplify-crud/. The package checks there first before falling back to its own stubs — so you only need to publish the ones you want to change.

Available stubs

stubs/simplify-crud/
├── model.stub
├── migration.stub
├── controller.stub
├── api-controller.stub
├── store-request.stub
├── update-request.stub
├── route.stub
├── api-route.stub
└── views/
    ├── tailwind/
    │   ├── index.stub
    │   ├── create.stub
    │   ├── edit.stub
    │   └── show.stub
    └── bootstrap/
        ├── index.stub
        ├── create.stub
        ├── edit.stub
        └── show.stub

Stub placeholders

Placeholder Example value
{{ ModelName }} ProductCategory
{{ modelName }} productCategory
{{ model_name }} product_category
{{ ModelNamePlural }} ProductCategories
{{ model_name_plural }} product_categories
{{ HumanName }} Product Category
{{ HumanNamePlural }} Product Categories
{{ table_name }} product_categories
{{ route_prefix }} product-categories
{{ fillable }} 'name', 'price'
{{ migration_fields }} $table->string('name');
{{ store_validation_rules }} 'name' => 'required|string|max:255'

Testing

composer test

Requires Composer dependencies to be installed first:

composer install
./vendor/bin/pest

Changelog

See CHANGELOG.md for release history.

License

MIT — see LICENSE for details.

Author

Amirul Islamamiruldev06@gmail.com

Built with care as a production-ready Laravel package following SOLID principles.