string('id')->primary(); $table->string('matherial_path'); $table->string('parent_id'); $table->string('name'); }); Schema::create('json_items', function(Blueprint $table){ $table->string('id')->primary(); $table->string('dir_id'); $table->string('key'); $table->string('name'); $table->string('description')->nullable(); $table->json('object'); $table->integer('disabled', false, true)->default(0); }); /** @var IFactory */ $factory = app(AppServiceProvider::ADMIN_MODULES)->getJsonObjectsFactory(); $item = $factory->getDtoFactory()->getItemFactory()->createPersist(\Src\Common\Dto\Object\ExampleComposit::EXAMPLE_COMPOSIT); $item->load(['key' => 'key', 'name' => 'name']); $attrs = $item->getInsertAttrs(); DB::table('json_items')->insert($attrs); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('admins'); } };