public function up()
{
    Schema::table('payments', function (Blueprint $table) {
        $table->unsignedBigInteger('invoice_id')->nullable();
        $table->foreign('invoice_id')->references('id')->on('invoices')->onDelete('cascade');
    });
}

public function down()
{
    Schema::table('payments', function (Blueprint $table) {
        $table->dropForeign(['invoice_id']);
        $table->dropColumn('invoice_id');
    });
}

