Laravel 10 · 11 · 12

Build CRUD from a schema, not a terminal.

mcrud/schema-studio gives Laravel projects a browser-based schema builder that generates CRUD, translations, dashboards, roles and permissions.

View on GitHub

Schema Builder

Design multiple tables on a visual canvas, connect them with one-to-many, one-to-one or many-to-many relations, and set column types, nullable/unique rules and defaults.

Localized UI

The studio and the generated code speak English and Arabic, with automatic RTL.

Secure by default

Authentication, rate limiting, a locked-down studio and optional roles and permissions with Spatie.

Install

composer require mcrud/schema-studio
php artisan vendor:publish --tag=crud-config

Laravel package discovery registers the package automatically. Open /crud-generator in your application to begin. For roles and permissions also run composer require spatie/laravel-permission, publish its migration with vendor:publish --provider="Spatie\Permission\PermissionServiceProvider" --tag="permission-migrations" and migrate; without it the generated code simply requires a logged-in user.

Design a schema

  1. Describe your project, or start from a template (Online Store, SaaS Workspace, Clinic, Restaurant).
  2. On the schema canvas, add tables such as Category and Product and define their columns. Drag ⋮⋮ to reorder columns.
  3. Drag the ● handle from one table onto another to create a relation: one to many, one to one or many to many. Foreign keys and pivot tables are created for you, and the Migration tab previews the code.
  4. Already have a database? Click Import from DB to bring existing tables, foreign keys and pivots onto the canvas, then add new columns or tables: new columns become an ALTER migration.
  5. Use undo/redo, zoom, pan and the minimap on larger schemas. Your draft is autosaved, and you can export the schema as JSON, the diagram as SVG/PNG, or copy a Mermaid ERD.
  6. Choose English and/or Arabic translations, the permissions to protect and roles such as admin, editor.
  7. Keep Run migrations & seed permissions and Create dashboard enabled, then generate.

What is generated?

Laravel code

For every table: migration, Eloquent model with relationships, resource controller, route registration and Blade index/form views. Many-to-many relations also get a pivot migration.

Authorization

A permission seeder per resource creates permissions and assigns them to the selected roles. Controllers protect each selected action.

Localization

Language files are placed in lang/en and/or lang/ar, and generated views use Laravel’s __() helper.

Relations

One to many

Adds parent_id (foreignId, constrained) to the child table, with hasMany and belongsTo methods.

One to one

Same as one to many, but the foreign key is unique and the parent uses hasOne.

Many to many

Creates a pivot table such as category_product and belongsToMany on both models.

Migrations are ordered so parent tables are created first. Circular one-to-many or one-to-one relations are rejected.

Migrate, seed & dashboard

With Run migrations & seed permissions enabled, the generator runs php artisan migrate --force (all pending migrations) and then every generated permission seeder. If a step fails, the files are kept and the message tells you what to run manually. To do it yourself:

php artisan migrate
php artisan db:seed --class=ProductPermissionSeeder

Create dashboard adds /dashboard with a count card linking to every generated table. It is skipped when a dashboard already exists.

Dashboard & layout

Admin layout

A sidebar and topbar with a mobile drawer, dark mode and RTL. Choose admin or simple with crud.layout.

Dashboard

Count cards, a 30-day growth chart per table and the latest records. Tables a user may not view are hidden.

Stubs

Every generated file is a stub. Publish them with --tag=crud-stubs and change what you need.

Authentication

Tick Generate authentication (or run php artisan crud:generate schema.json --auth) for login, forgot and reset password, a profile page, optional public registration and optional email verification. Every generated route then requires login, and login, registration and forgot-password are rate limited. With permissions you also get users and roles management with a permission matrix, and an AdminUserSeeder that creates the first administrator from ADMIN_EMAIL and ADMIN_PASSWORD. It is skipped when your application already has a login route.

Fields & list tools

More column types

password, color, slug, image and file join the standard types, with hashing, uploads and generated slugs handled for you.

Index pages

Date-range filters, column visibility, CSV export and import, bulk delete and, for soft-delete tables, restore and delete forever.

Large relations

Foreign keys to big tables become a search box instead of a huge dropdown (crud.lookup_threshold).

Updating generated code

The generator never overwrites your files. After changing the schema, review and merge with:

php artisan crud:diff schema.json
php artisan crud:sync schema.json            # merge with conflict markers, *.bak kept
php artisan crud:sync schema.json --force    # replace differing files

Roadmap

Planned: polymorphic relations, a role-column permission driver that does not need Spatie, file uploads and restore in the generated API, crud:sync for migrations and routes, translated generated pages, and Livewire or Inertia output. See the changelog for what shipped.

Configuration & safety

Publish configuration with the install command above. Because the generator writes files and can run migrations, outside local development it answers 403 until you set crud.ability to a Gate ability (or set crud.require_ability to false behind your own admin middleware). Its endpoints are rate limited, and it never runs in production unless you allow it. Never expose it publicly. It never overwrites existing files: tables whose model, controller, view or migration already exist are skipped, so you can re-run it to add new tables.