id(); $table->string('name'); $table->text('description')->nullable(); $table->unsignedBigInteger('parent_id')->nullable(); $table->foreign('parent_id')->references('id')->on('projects')->onDelete('cascade'); $table->unique(['name','parent_id']); $table->softDeletes(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('projects'); } }