For devs and CTOs
It writes the CRUD. You write the rest.
Tables, screens and rules built visually, in code or by the agent. Out comes Eloquent, Blade and Alpine in a standard Laravel project that you review, version and maintain.
Read what it generates before you trust it.
One form, the three files it produces. Hover a field to see its lines in the Blade, the model and the controller.
resources/views/venda-form.blade.php
<mad-form submit="onSave" data-mad-entity-id="693"><mad-form-section title="Cadastro de Venda" icon="file-text"><mad-form-grid :cols="2"><mad-dbcombo-field data-mad-column-id="4533" data-mad-entity-id="693" data-mad-ref-entity-id="691" data-mad-ref-column-id="4521" data-mad-ref-display-column-id="4522" name="pessoa_id" label="Pessoa" database="app" model="Pessoa" key="id" display="{nome}" order-by="nome" order="asc" :required="true" /><mad-date-field data-mad-column-id="4534" data-mad-entity-id="693" name="data" label="Data" :required="true" /></mad-form-grid><mad-form-grid :cols="2"><mad-money-field name="total" label="Total" prefix="R$" :decimals="2" :readonly="true" /><mad-input-field data-mad-column-id="4536" data-mad-entity-id="693" name="status" label="Status" /></mad-form-grid></mad-form-section><mad-form-actions><mad-btn variant="primary" type="submit" icon="save">Salvar</mad-btn></mad-form-actions></mad-form> app/Models/App/Venda.php
<?phpnamespace App\Models\App;use Illuminate\Database\Eloquent\Model;use Illuminate\Database\Eloquent\Relations\BelongsTo;use Illuminate\Database\Eloquent\Relations\HasMany;use Mad\Database\Concerns\HasIdPolicy;use Mad\Database\Concerns\HasMadAudit;class Venda extends Model{use HasIdPolicy, HasMadAudit;protected $connection = 'app';protected $table = 'venda';// Colunas de auditoria/soft-delete desta tabela (chave ausente = desligada).protected array $madAudit = ['created_at' => 'created_at','updated_at' => 'updated_at',];protected $fillable = ['pessoa_id','data','total','status',];public static function rules($id = null): array{return ['pessoa_id' => 'required|integer','data' => 'required','total' => 'nullable|numeric','status' => 'nullable|max:20',];}public function pessoa(): BelongsTo{return $this->belongsTo(Pessoa::class, 'pessoa_id');}public function vendaItems(): HasMany{return $this->hasMany(VendaItem::class, 'venda_id');}protected static function booted(): void{static::deleting(function (self $model) {if (VendaItem::where('venda_id', '=', $model->id)->exists()) {throw new \Exception('Não é possível deletar este registro pois ele está sendo utilizado em outra parte do sistema');}});}} app/Control/VendaForm.php
<?phpuse Mad\Component\MadComponent;use Mad\Form\MadForm;use Mad\Form\MadValidationException;use Mad\Http\MadResponse;use Mad\Ui\MadMessage;use App\Models\App\Venda;use Illuminate\Support\Facades\DB;// use App\Control\VendaList;// @mad-block:user:uses {// @mad-block:user:uses }/*** @mad-generated* @mad-entity-id 693*/class VendaForm extends MadComponent{// @mad-block:config:properties {protected static string $wrapper = self::DRAWER;protected static string $title = 'Cadastro de Venda';protected static string $size = '600px';protected static string $side = 'right';public MadForm $form;// int|string: tabela cuja PK é varchar/char (código, matrícula) tem chave// de texto — `int` transformaria 'ABC-1' em 0 e salvaria no registro errado.public int|string|null $recordId = null;// @mad-block:config:properties }// @mad-block:user:properties {// @mad-block:user:properties }// @mad-block:lifecycle:mount {public function mount(array $params = []): void{$this->form = new MadForm('form');if (! empty($params['id'])) {$this->onEdit($params['id']);}}// @mad-block:lifecycle:mount }// @mad-block:lifecycle:onEdit {public function onEdit(int|string $id): void{// @mad-block:locked:onEdit:master {$venda = Venda::findOrFail($id);$this->recordId = $venda->getKey();// @mad-block:locked:onEdit:master }// @mad-block:detail-load-hooks {// @mad-block:detail-load-hooks }$this->form->fill($venda);}// @mad-block:lifecycle:onEdit }// @mad-block:lifecycle:onSave {public function onSave(): MadResponse{try {$this->form->validate(Venda::rules($this->recordId));$venda = DB::connection('app')->transaction(function () {// @mad-block:locked:onSave:master {$venda = Venda::findOrNew($this->recordId);// @mad-block:locked:onSave:master }// @mad-block:detail-save-hooks {// @mad-block:detail-save-hooks }$this->form->save($venda);$this->recordId = $venda->getKey();return $venda;});// @mad-block:combo-origin {// Tela aberta por um combo ("Sem resultados → Cadastrar novo"):// devolve a option nova selecionada e fecha o overlay. Fora desse// caso returnToCombo() responde null e o fluxo normal segue.if (($__combo = $this->returnToCombo($this->recordId)) !== null) {return $__combo;}// @mad-block:combo-origin }// @mad-block:after-save {return (new MadResponse())->toast('Registro salvo com sucesso!', 'success')->closeDrawer()->manageRow($this->recordId, VendaList::class);// @mad-block:after-save }} catch (MadValidationException $e) {return $e->asInline();} catch (\Throwable $e) {return MadMessage::error('Erro ao salvar', $e->getMessage());}}// @mad-block:lifecycle:onSave }// Caminho da view gerado pela plataforma a partir da PASTA DO MÓDULO.// Bloco byte-exact: NÃO edite — trocar o módulo regenera este path sozinho.// @mad-block:locked:view-name {protected function viewName(): string{return 'venda-form';}// @mad-block:locked:view-name }// @mad-block:lifecycle:view {protected function view(): string|array{$replaces = [];return [$this->viewName(), $replaces];}// @mad-block:lifecycle:view }// @mad-block:user:functions {// @mad-block:user:functions }} Your code survives the next generation.
The generated controller is split into blocks. The ones the interface controls are locked. The @mad-block:user blocks are yours: when the screen changes and the file is generated again, they stay exactly as you left them.
- Your own imports, properties and functions in their own blocks
- Validation through the model's
rules(), saving inside a transaction - A PHP component you can read top to bottom, built on the framework's MadComponent
<?phpuse Mad\Component\MadComponent;use Mad\Form\MadForm;use Mad\Form\MadValidationException;use Mad\Http\MadResponse;use Mad\Ui\MadMessage;use App\Models\App\Venda;use Illuminate\Support\Facades\DB;// use App\Control\VendaList;// @mad-block:user:uses {// @mad-block:user:uses }/*** @mad-generated* @mad-entity-id 693*/class VendaForm extends MadComponent{// @mad-block:config:properties {protected static string $wrapper = self::DRAWER;protected static string $title = 'Cadastro de Venda';protected static string $size = '600px';protected static string $side = 'right';public MadForm $form;// int|string: tabela cuja PK é varchar/char (código, matrícula) tem chave// de texto — `int` transformaria 'ABC-1' em 0 e salvaria no registro errado.public int|string|null $recordId = null;// @mad-block:config:properties }// @mad-block:user:properties {// @mad-block:user:properties }// @mad-block:lifecycle:mount {public function mount(array $params = []): void{$this->form = new MadForm('form');if (! empty($params['id'])) {$this->onEdit($params['id']);}}// @mad-block:lifecycle:mount }// @mad-block:lifecycle:onEdit {public function onEdit(int|string $id): void{// @mad-block:locked:onEdit:master {$venda = Venda::findOrFail($id);$this->recordId = $venda->getKey();// @mad-block:locked:onEdit:master }// @mad-block:detail-load-hooks {// @mad-block:detail-load-hooks }$this->form->fill($venda);}// @mad-block:lifecycle:onEdit }// @mad-block:lifecycle:onSave {public function onSave(): MadResponse{try {$this->form->validate(Venda::rules($this->recordId));$venda = DB::connection('app')->transaction(function () {// @mad-block:locked:onSave:master {$venda = Venda::findOrNew($this->recordId);// @mad-block:locked:onSave:master }// @mad-block:detail-save-hooks {// @mad-block:detail-save-hooks }$this->form->save($venda);$this->recordId = $venda->getKey();return $venda;});// @mad-block:combo-origin {// Tela aberta por um combo ("Sem resultados → Cadastrar novo"):// devolve a option nova selecionada e fecha o overlay. Fora desse// caso returnToCombo() responde null e o fluxo normal segue.if (($__combo = $this->returnToCombo($this->recordId)) !== null) {return $__combo;}// @mad-block:combo-origin }// @mad-block:after-save {return (new MadResponse())->toast('Registro salvo com sucesso!', 'success')->closeDrawer()->manageRow($this->recordId, VendaList::class);// @mad-block:after-save }} catch (MadValidationException $e) {return $e->asInline();} catch (\Throwable $e) {return MadMessage::error('Erro ao salvar', $e->getMessage());}}// @mad-block:lifecycle:onSave }// Caminho da view gerado pela plataforma a partir da PASTA DO MÓDULO.// Bloco byte-exact: NÃO edite — trocar o módulo regenera este path sozinho.// @mad-block:locked:view-name {protected function viewName(): string{return 'venda-form';}// @mad-block:locked:view-name }// @mad-block:lifecycle:view {protected function view(): string|array{$replaces = [];return [$this->viewName(), $replaces];}// @mad-block:lifecycle:view }// @mad-block:user:functions {// @mad-block:user:functions }} Bring your own agent. Or use ours.
The MadBuilder agent reads the database, creates tables and generates screens in the same project you edit. It writes the MAD component tag, not the HTML, CSS and JS behind it, so it spends 65% to 75% fewer tokens.
$ claude mcp add madbuilder --token mgw_•••• --project 1042 - Claude Code, Cursor or any MCP client
- A dedicated token per project, revocable instantly
- Per-tool permissions and an audit log of every call
- Your own Anthropic, OpenRouter, xAI, Z.AI or Ark key, or the Mad Coding Plan
You 14:05
Create a sales CRUD with items (master-detail): a sale has a customer, date and total amount; each item has a product, quantity and unit price. Generate the list view and the form.
Agent 14:08
- I’ll create the master-detail CRUD for sales. First I need to check the database and create the tables that don’t exist yet.
mad_db_inspect list_tables17 tables in the model, none for sales- I need to create produto, venda and venda_item. I’ll use pessoa as the customer.
mad_db_table create produtonome, preco_venda, unidade, ativo and the Produto modelmad_db_table create vendacliente_id, data_venda, valor_total and the Venda modelmad_db_table create venda_itemvenda_id, produto_id, quantidade, valor_unitario, valor_total and the VendaItem model- Tables created. Now I’ll load the MAD framework skill and generate the master-detail CRUD.
skill mad-frameworkskill loadedcrud_generate venda + detalhe venda_item2 screens created: VendaList and VendaForm
No proprietary engine in the middle.
What runs in production is your Laravel project. MadBuilder stays in your workflow, not on your server.
Laravel, Eloquent, Blade and Alpine
The generated app declares laravel/framework ^13.8 and the MAD framework ships inside the project.
Six databases
MySQL or MariaDB, PostgreSQL, SQLite, Oracle, SQL Server and Firebird.
SSH, Git or ZIP
SSH deploy keeps the last 5 backups. Git pushes to GitHub, GitLab or Bitbucket.
Test environment in one click
PHP 8.4 or 8.5, with PostgreSQL, MySQL, MariaDB or SQLite, isolated per project.
Built-in errors and APM
Opt-in tracing, no need to buy Sentry or New Relic separately.
Clean routes
One URL per screen, with validated uniqueness and protected reserved routes.
Questions from the people who will maintain the code
What if I want to leave MadBuilder?
Download the ZIP or push to your Git. It is a regular Laravel project, with the MAD framework inside the packages folder. It runs without MadBuilder and any Laravel dev can maintain it.
What happens to the code I write by hand?
It lives inside the @mad-block:user blocks. When someone changes the screen and the file is generated again, those blocks are preserved. The parts the interface controls are locked and marked in the editor.
Can I edit PHP and Blade directly?
Yes. Visual, PHP and Blade are three views of the same file. What you change in one shows up in the others.
Can I version it in Git?
Yes. Git Deploy pushes to GitHub, GitLab or Bitbucket, and you choose the folders that stay out, like vendor and storage.
Which databases are supported?
MySQL or MariaDB, PostgreSQL, SQLite, Oracle, SQL Server and Firebird.
Can I use my own AI agent instead of yours?
Yes. The project exposes an MCP server: Claude Code, Cursor or any MCP client creates screens, models data and deploys, with one token per project and every call logged.
Download the .zip before booking a meeting.
Create an account, build a screen and open the project in your editor. If the code fails your team's review, you lost an afternoon.
- Create an accountOpen beta, no credit card.
- Build a screenVisually, in code, or by asking the AI.
- Download the .zipA Laravel project that runs wherever you want.