bigIncrements('id'); $table->string('no_expense')->nullable(); $table->date('expense_date'); $table->bigInteger('expense_account_id')->unsigned(); $table->foreign('expense_account_id') ->references('id') ->on('chart_of_accounts') ->onDelete('cascade'); $table->string('amount'); $table->bigInteger('payment_account_id')->unsigned(); $table->foreign('payment_account_id') ->references('id') ->on('chart_of_accounts') ->onDelete('cascade'); $table->bigInteger('tax_id')->unsigned()->nullable(); $table->foreign('tax_id') ->references('id') ->on('taxes') ->onDelete('set null'); $table->string('tax_rate')->nullable(); $table->bigInteger('supplier_id')->unsigned()->nullable(); // $table->foreign('supplier_id') // ->references('id') // ->on('suppliers') // ->onDelete('set null'); $table->bigInteger('customer_id')->unsigned()->nullable(); // $table->foreign('customer_id') // ->references('id') // ->on('customers') // ->onDelete('set null'); $table->text('notes')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('expenses'); } }