<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cards', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('user_id')->nullable();
$table->string('slug')->unique();
$table->text('name');
$table->string('type')->comment('Type:Live,Test');
$table->text('card_number'); // Remove unique() constraint from here
$table->string('card_number_hash'); // Add this line for the hashed card number
$table->text('card_cvc');
$table->text('expiry_date');
$table->boolean('default')->default(false);
$table->timestamps();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade');
// Add a unique index for card_number_hash to ensure uniqueness per user
$table->unique(['user_id', 'card_number_hash']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('cards');
}
};
How To Payment
Making a payment on our website is quick and secure. Start by logging in or creating an account. Select your preferred payment method, input the required details, and review the information. Once you confirm everything is correct, click on the "Submit Payment" button. You’ll receive instant confirmation and can track your payment status through your account dashboard. It’s an easy and secure process.