added crypto pm and activation key system
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('activation_keys', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->nullable()->constrained()->nullOnDelete();
|
||||
$table->string('activation_key')->unique();
|
||||
$table->string('price_id')->collation('utf8_bin');
|
||||
$table->boolean('is_activated')->default(false);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('activation_keys');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('plans', function (Blueprint $table) {
|
||||
$table->string('shoppy_product_id')->nullable()->after('pricing_id');
|
||||
$table->boolean('accept_stripe')->default(false)->after('shoppy_product_id');
|
||||
$table->boolean('accept_shoppy')->default(false)->after('accept_stripe');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('plans', function (Blueprint $table) {
|
||||
$table->dropColumn(['shoppy_product_id', 'accept_stripe', 'accept_shoppy']);
|
||||
});
|
||||
}
|
||||
};
|
||||
28
database/seeders/UpdatePlansTableSeeder.php
Normal file
28
database/seeders/UpdatePlansTableSeeder.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Plan;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class UpdatePlansTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
Plan::where('id', 1)->update([
|
||||
'shoppy_product_id' => 'MsYfrRX',
|
||||
'accept_stripe' => 1,
|
||||
'accept_shoppy' => 1,
|
||||
]);
|
||||
|
||||
Plan::where('id', 2)->update([
|
||||
'shoppy_product_id' => '1oU5SNT',
|
||||
'accept_stripe' => 1,
|
||||
'accept_shoppy' => 1,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user