id(); $table->morphs('owner'); $table->string('type')->default(TransactionType::PAYMENT); $table->foreignId('issuer')->unsigned(); $table->foreignId('receiver')->unsigned(); $table->foreignId('recipient_bank_account_id')->unsigned(); $table->string('payment_method')->nullable(); $table->string('payment_reference')->nullable(); $table->string('bill_no')->unique(); $table->decimal('amount', 14, 5)->default(0.00); $table->decimal('original_amount', 14, 5)->default(0.00); $table->foreignId('currency_id')->unsigned(); $table->foreignId('original_currency_id')->unsigned(); $table->decimal('currency_rate', 14, 5)->default(0.00); $table->decimal('tax', 14, 5)->default(0.00); $table->decimal('service_charge', 14, 5)->default(0.00); $table->timestamp('expires_on')->nullable(); $table->integer('status')->default(ApprovalStatus::PENDING_SUBMISSION); $table->softDeletes(); $table->timestamps(); $table->foreign('currency_id')->references('id')->on('currencies'); $table->foreign('issuer')->references('id')->on('companies'); $table->foreign('receiver')->references('id')->on('companies'); $table->foreign('recipient_bank_account_id')->references('id')->on('banks'); $table->foreign('original_currency_id')->references('id')->on('currencies'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('transaction'); } }