bigIncrements('id'); $table->unsignedBigInteger('user_id')->unsigned(); $table->unsignedBigInteger('lelong_id')->unsigned(); $table->string('invoice_no')->nullable(); $table->decimal('total_invoice', $precision = 11, $scale = 2); $table->string('invoice_type'); // 1 = fee , 2 = bid $table->string('status')->nullable(); // status => 1 = paid , 2 = pending $table->string('opencash')->nullable()->default(0); $table->timestamp('paid_at')->nullable(); $table->timestamps(); $table->foreign('user_id') ->references('id')->on('users') ->onDelete('cascade'); $table->foreign('lelong_id') ->references('id')->on('lelong') ->onDelete('cascade'); }); Schema::create('resit', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedBigInteger('user_id')->unsigned(); $table->unsignedBigInteger('lelong_id')->unsigned(); $table->string('reference_no')->nullable(); $table->unsignedBigInteger('invoice_id')->unsigned(); $table->string('invoice_no')->nullable(); $table->string('billplz_id'); $table->decimal('total_payment', $precision = 11, $scale = 2); $table->string('resit_type'); // 1 = fee , 2 = bid $table->string('status')->nullable(); // status => 1 = paid , 2 = pending $table->longText('response'); $table->timestamp('paid_at')->nullable(); $table->timestamps(); $table->foreign('invoice_id') ->references('id')->on('invoice') ->onDelete('cascade'); $table->foreign('user_id') ->references('id')->on('users') ->onDelete('cascade'); $table->foreign('lelong_id') ->references('id')->on('lelong') ->onDelete('cascade'); }); Schema::create('payment', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedBigInteger('user_id')->unsigned(); $table->unsignedBigInteger('lelong_id')->unsigned(); $table->unsignedBigInteger('lelongbid_id')->unsigned(); $table->unsignedBigInteger('resit_id')->unsigned(); $table->string('kodcaw')->nullable(); $table->integer('invoice_id')->nullable(); $table->string('norujukan')->nullable(); $table->string('back_acc_pembeli')->nullable(); $table->string('bank_acc_no_pembeli')->nullable(); $table->string('nama_bank_acc_caw')->nullable(); $table->string('bank_no_acc_caw')->nullable(); $table->integer('status_payment_opt')->nullable(); // 1=kaunter,2=online,3=CDM $table->integer('status'); // 1 = fee RM10 , 2 = paybidifwin $table->string('remark'); $table->integer('1sen')->nullable(); $table->integer('5sen')->nullable(); $table->integer('10sen')->nullable(); $table->integer('20sen')->nullable(); $table->integer('50sen')->nullable(); $table->integer('rm1')->nullable(); $table->integer('rm5')->nullable(); $table->integer('rm10')->nullable(); $table->integer('rm20')->nullable(); $table->integer('rm50')->nullable(); $table->integer('rm100')->nullable(); $table->decimal('total_payment', $precision = 11, $scale = 2); $table->datetime('disahkan_pada')->nullable(); $table->integer('disahkan_oleh')->nullable(); $table->datetime('diminta_pada')->nullable(); $table->integer('diminta_oleh')->nullable(); $table->timestamps(); $table->foreign('resit_id') ->references('id')->on('resit') ->onDelete('cascade'); $table->foreign('user_id') ->references('id')->on('users') ->onDelete('cascade'); $table->foreign('lelong_id') ->references('id')->on('lelong') ->onDelete('cascade'); $table->foreign('lelongbid_id') ->references('id')->on('lelongbid') ->onDelete('cascade'); }); Schema::create('paydenokaunter', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedBigInteger('user_id')->unsigned(); $table->unsignedBigInteger('lelong_id')->unsigned(); $table->string('kodcaw')->nullable(); $table->integer('status_payment_opt')->nullable(); // 1=kaunter,2=online,3=CDM $table->integer('resit_id'); $table->integer('status'); // 1 = fee RM10 , 2 = paybidifwin $table->string('remark'); $table->integer('1sen')->nullable(); $table->integer('5sen')->nullable(); $table->integer('10sen')->nullable(); $table->integer('20sen')->nullable(); $table->integer('50sen')->nullable(); $table->integer('rm1')->nullable(); $table->integer('rm5')->nullable(); $table->integer('rm10')->nullable(); $table->integer('rm20')->nullable(); $table->integer('rm50')->nullable(); $table->integer('rm100')->nullable(); $table->decimal('total_payment', $precision = 11, $scale = 2); $table->datetime('disahkan_pada')->nullable(); $table->integer('disahkan_oleh')->nullable(); $table->datetime('diminta_pada')->nullable(); $table->integer('diminta_oleh')->nullable(); $table->timestamps(); $table->foreign('user_id') ->references('id')->on('users') ->onDelete('cascade'); $table->foreign('lelong_id') ->references('id')->on('lelong') ->onDelete('cascade'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('payment'); Schema::dropIfExists('paydenokaunter'); Schema::dropIfExists('resit'); Schema::dropIfExists('invoice'); } }