increments('id'); $table->unsignedInteger('learning_product_id'); $table->string('credits')->nullable(); $table->dateTime('date_start', 0)->nullable(); $table->dateTime('date_end', 0)->nullable(); $table->timestamps(); $table->softDeletes(); }); Schema::table('accreditations', function (Blueprint $table) { $table->foreign('learning_product_id')->references('id')->on('learning_products')->onDelete('cascade'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('accreditations', function (Blueprint $table) { $table->dropForeign('accreditations_learning_product_id_foreign'); }); Schema::dropIfExists('accreditations'); } }