id(); $table->unsignedInteger('site_id'); $table->string('name'); $table->text('command'); $table->timestamps(); }); foreach (Site::all() as $site) { $site->commands()->createMany($site->type()->baseCommands()); } } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('commands'); } };