keshavjha / curdder
A Laravel CRUD wizard that inspects database tables, manages joins, and generates CRUD config inside the host app.
Requires
- php: ^8.1
README
Curdder is a Laravel CRUD wizard package that installs into a host Laravel app and generates CRUD config, models, and web CRUD routes inside that app.
It is designed for workflows like this:
- inspect the current database schema
- drag tables into a visual workspace
- connect columns with relation lines
- choose relation types like
belongsTo,hasOne,hasMany, andbelongsToMany - generate CRUD config and Laravel models in the applied project
- create new tables from the same wizard
- edit existing tables from the same wizard
What It Creates
Curdder currently generates:
- a CRUD config file in the host app
- Eloquent models in
app/Models - web CRUD pages for each generated resource
- a Laravel wizard UI for table selection, relation building, and table creation
Curdder does not currently generate API CRUD endpoints.
Install
composer require keshavjha/curdder
Laravel package auto-discovery will register the service provider automatically.
If you want to customize the wizard URL or output file, set these environment variables in the host app:
CRUDDER_PATH=crudder CRUDDER_GENERATED_FILE=storage/app/crudder.php
You can also adjust the config in config/crudder.php after publishing it into the Laravel app.
Wizard URLs
After installing in the host Laravel app, open:
/crudder/crudder/tables/create
If you change CRUDDER_PATH, the wizard will move under that prefix.
How The Wizard Works
1. Open the wizard
Visit /crudder to load the current schema from the connected database.
2. Drag tables into the workspace
Drag the tables you want to use into the visual board. The workspace is where you define the structure of the CRUD build.
3. Connect relations visually
Click a source column, then click a target column to draw a relation line between them.
You can also add a relation from inside the table card itself.
4. Pick relation type
Use the relation settings panel to choose the relation type:
belongsTohasOnehasManybelongsToMany
5. Generate config and models
When you generate, Curdder stores the config file in the host app and writes Eloquent models into app/Models if they do not already exist.
Create Tables
You can create new database tables from the wizard at /crudder/tables/create.
If you need to change an existing table, open the edit link next to that table in the schema list. The editor loads the current columns, lets you adjust them, and rebuilds the table while preserving data from columns that still exist.
This is useful when you want to build out a schema inside the same Laravel app before generating CRUD for it.
Generated Output
By default, the generated config is written to:
storage/app/crudder.php
The generated config includes:
- app metadata
- inspected table resources
- foreign-key style join rules
- the visual graph state
- the selected relation data
Relation Graph
Curdder stores relations in the graph as table and column pairs, for example:
{
"type": "belongsTo",
"from_table": "posts",
"from_column": "user_id",
"to_table": "users",
"to_column": "id",
"label_column": "name"
}
The wizard uses this information to:
- draw the connectors in the workspace
- generate model relationship methods
- generate foreign-key style join rules for the CRUD config
Notes
- This package is intended to run inside the Laravel project you want to generate CRUD for.
- It does not create a separate standalone CRUD app anymore.
- If the wizard UI looks stale after an update, clear compiled views with
php artisan view:clear.
Development
If you are working on the package itself, the main Laravel integration lives in:
src/Laravel/CurdderServiceProvider.phpsrc/Laravel/Http/Controllers/CrudderWizardController.phpresources/views/wizard.blade.php
The schema/config layer lives in:
src/Schema/DatabaseSchemaInspector.phpsrc/Generator/ConfigGenerator.php