takielias/tablar-crud-generator

Scaffolds a complete CRUD set (Model, Controller, Views, Route) for an EXISTING database table via one artisan command. Built for projects already running takielias/tablar (Tabler-based admin layout) and pairs naturally with takielias/tablar-kit and takielias/lab.
Inspired by ibex/crud-generator.
$fillable, validation $rules, and optional SoftDeletes.index, create, edit, show, form, form-field, view-field).Route::resource(...) entry to routes/web.php.ajax-submit-button class for native fetch + spinner UX out of the box.<i class="ti ti-...">) match the published tablar layout idiom.resources/boost/ for in-editor agent help.| Component | Minimum |
|---|---|
| PHP | 8.2 |
| Laravel | 10.32+ / 11.x / 12.x / 13.x (uses Schema::getColumns/getIndexes/getForeignKeys) |
| Tablar | takielias/tablar (recommended for the published tablar::page layout) |
composer require takielias/tablar-crud-generator --dev
Service provider auto-discovered via extra.laravel.providers.
Optional: publish the config (only needed if you want to customize stub paths or naming):
php artisan vendor:publish --tag=crud
The generator reads the live database schema to infer field types — so the table must already exist before running:
# 1. Create + edit the migration
php artisan make:migration create_products_table
# 2. Run migration (table must exist before make:crud)
php artisan migrate
# 3. Scaffold CRUD
php artisan make:crud products
The argument is the DB table name (plural, snake_case). Class names + view paths are inferred via Str::studly(Str::singular($table)).
make:crud {name}
{--route= : Custom route name}
{--crud-name= : Custom crud name}
{--lang= : pluralizer language}
Examples:
# Custom route segment
php artisan make:crud products --route=admin/products
# Custom class / view path name
php artisan make:crud emergencies --crud-name=Emergencies
# French / Norwegian / Portuguese / Spanish / Turkish pluralization
php artisan make:crud incidencies --lang=spanish
| File | Notes |
|---|---|
app/Models/Product.php |
$fillable from columns, $rules from NOT NULL constraints, optional SoftDeletes if a deleted_at column exists |
app/Http/Controllers/ProductController.php |
Resource controller (index/create/store/show/edit/update/destroy) using Product::paginate(10) |
resources/views/product/index.blade.php |
Tabler list view with action dropdown |
resources/views/product/create.blade.php |
Includes form.blade.php |
resources/views/product/edit.blade.php |
Includes form.blade.php with method spoofing |
resources/views/product/show.blade.php |
Read-only detail page |
resources/views/product/form.blade.php |
Field rendering wrapper, ends with <button class="btn btn-primary ms-auto ajax-submit-button has-spinner">Submit</button> |
resources/views/product/form-field.blade.php |
Per-column form field markup |
resources/views/product/view-field.blade.php |
Per-column read-only markup |
| Route entry | Appended to routes/web.php: Route::resource('/products', App\Http\Controllers\ProductController::class); |
The generator does NOT create the migration. Define + migrate the table first.
Generated views follow tablar's published layout idiom:
@extends('tablar::page')
@section('title', '{{modelTitle}}')
@section('content')
<div class="page-header d-print-none">
<div class="container-xl">
<div class="row g-2 align-items-center">
<div class="col">
<div class="page-pretitle">List</div>
<h2 class="page-title">{{ __('{{modelTitle}}') }}</h2>
</div>
<div class="col-12 col-md-auto ms-auto d-print-none">
<div class="btn-list">
<a href="..." class="btn btn-primary"><i class="ti ti-plus me-1"></i> Create</a>
</div>
</div>
</div>
</div>
</div>
<div class="page-body">
<div class="container-xl">
<div class="card">...</div>
</div>
</div>
@endsection
Override crud.layout in config/crud.php to extend a different master layout.
The generator overwrites without prompting and appends Route::resource(...) on every run (no idempotency check). Workflow when re-scaffolding:
git add -A && git commit -m "wip: pre-regenerate"
sed -i '/Route::resource.*ProductController::class/d' routes/web.php
php artisan make:crud products
| Driver | Status |
|---|---|
| SQLite | ✅ tested |
| MySQL / MariaDB | ✅ tested |
| PostgreSQL | ✅ tested |
| SQL Server | ✅ supported (same Schema API surface) |
Schema introspection uses Schema::getColumns(), Schema::getIndexes(), and Schema::getForeignKeys() — driver-agnostic since Laravel 10.32.
This package ships Boost-compatible guidelines + skills under resources/boost/. Consumer apps with laravel/boost installed get them automatically:
composer require laravel/boost --dev
php artisan boost:install # opt into "skills" feature; select takielias/tablar-crud-generator
Once published, your AI agent (Claude Code, Cursor, Copilot, etc.) can use the tablar-crud-generator-development skill to answer questions about flag semantics, generated file shapes, and stub customization without reading source.

Taki Elias — @takiele — ebuz.xyz — taki.elias@gmail.com
How can I help you explore Laravel packages today?