bigIncrements('id'); $table->bigInteger('sale_order_id')->unsigned(); $table->foreign('sale_order_id') ->references('id') ->on('sale_orders') ->onDelete('cascade'); $table->string('no_invoice'); $table->date('invoice_date'); $table->date('due_date'); $table->string('amount'); $table->enum('status', ['draft', 'sent']); $table->bigInteger('chart_of_account_id')->unsigned()->nullable(); $table->foreign('chart_of_account_id') ->references('id') ->on('chart_of_accounts') ->onDelete('cascade'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('invoices'); } }