Builder administration area
* Page builder foundation * Form builder document type * Dashboard builder document type * Report builder document type * Menu builder document type * Email builder document type * Query builder document type * Workflow builder document type * Reusable component registry * Form-field registry * Dashboard-widget registry * Hero, heading, and rich-content components * JSON document schema * Saved builder documents * Draft, published, and archived states * Document version history * Reusable builder templates * Component rendering service * Extensible BuilderComponent contract * Authenticated Builder REST endpoints * Administration navigation * Builder permissions * Module registration and test
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
return new class extends Migration {
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('builder_documents', function (Blueprint $table) {
|
||||
$table->id(); $table->foreignId('site_id')->nullable()->constrained('sites')->nullOnDelete();
|
||||
$table->string('type',30)->index(); $table->string('name'); $table->string('slug')->nullable();
|
||||
$table->string('status',20)->default('draft')->index(); $table->unsignedInteger('version')->default(1);
|
||||
$table->json('document')->nullable(); $table->json('settings')->nullable();
|
||||
$table->nullableMorphs('buildable'); $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->timestamp('published_at')->nullable(); $table->timestamps();
|
||||
$table->unique(['site_id','type','slug'],'builder_document_site_type_slug_unique');
|
||||
});
|
||||
Schema::create('builder_document_versions', function (Blueprint $table) {
|
||||
$table->id(); $table->foreignId('builder_document_id')->constrained('builder_documents')->cascadeOnDelete();
|
||||
$table->unsignedInteger('version'); $table->json('document'); $table->json('settings')->nullable();
|
||||
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete(); $table->timestamps();
|
||||
$table->unique(['builder_document_id','version']);
|
||||
});
|
||||
Schema::create('builder_templates', function (Blueprint $table) {
|
||||
$table->id(); $table->string('type',30)->index(); $table->string('name'); $table->string('slug')->unique();
|
||||
$table->text('description')->nullable(); $table->json('document'); $table->json('settings')->nullable();
|
||||
$table->boolean('is_system')->default(false); $table->boolean('is_active')->default(true)->index(); $table->timestamps();
|
||||
});
|
||||
}
|
||||
public function down(): void { Schema::dropIfExists('builder_templates'); Schema::dropIfExists('builder_document_versions'); Schema::dropIfExists('builder_documents'); }
|
||||
};
|
||||
Reference in New Issue
Block a user