diff --git a/database/migrations/2025_09_06_093716_add_kyc_and_vip_to_users_table.php b/database/migrations/2025_09_06_093716_add_kyc_and_vip_to_users_table.php new file mode 100644 index 0000000..2c44fde --- /dev/null +++ b/database/migrations/2025_09_06_093716_add_kyc_and_vip_to_users_table.php @@ -0,0 +1,30 @@ +boolean('is_kyc_verified')->default(false)->comment('KYC-like verification status'); + $table->integer('vip_level')->default(0)->comment('VIP status: 0 = standard, 1-5 = tiers'); + $table->timestamp('last_login_at')->nullable()->comment('For tracking activity'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('users', function (Blueprint $table) { + $table->dropColumn(['is_kyc_verified', 'vip_level', 'last_login_at']); + }); + } +}; diff --git a/database/migrations/2025_09_06_093819_create_wallets_table.php b/database/migrations/2025_09_06_093819_create_wallets_table.php new file mode 100644 index 0000000..4ae3821 --- /dev/null +++ b/database/migrations/2025_09_06_093819_create_wallets_table.php @@ -0,0 +1,29 @@ +id(); + $table->foreignId('user_id')->constrained()->cascadeOnDelete()->comment('Links to user'); + $table->decimal('balance', 15, 2)->default(0.00)->comment('Skunk Coins balance'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('wallets'); + } +}; diff --git a/database/migrations/2025_09_06_093855_create_transactions_table.php b/database/migrations/2025_09_06_093855_create_transactions_table.php new file mode 100644 index 0000000..1bdf66c --- /dev/null +++ b/database/migrations/2025_09_06_093855_create_transactions_table.php @@ -0,0 +1,26 @@ +id(); + $table->foreignId('wallet_id')->constrained()->cascadeOnDelete()->comment('Links to wallet'); + $table->decimal('amount', 15, 2)->comment('Amount transacted'); + $table->enum('type', ['bet', 'win', 'deposit', 'withdrawal'])->comment('Transaction type'); + $table->text('description')->nullable()->comment('Details, e.g., "Bet on Plinko"'); + $table->string('hash')->comment('SHA-256 hash for validation'); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('transactions'); + } +}; \ No newline at end of file diff --git a/database/migrations/2025_09_06_093949_create_games_table.php b/database/migrations/2025_09_06_093949_create_games_table.php new file mode 100644 index 0000000..b214c2b --- /dev/null +++ b/database/migrations/2025_09_06_093949_create_games_table.php @@ -0,0 +1,26 @@ +id(); + $table->string('name')->comment('Game name, e.g., Plinko'); + $table->string('slug')->unique()->comment('URL-friendly slug'); + $table->string('thumbnail_url')->nullable()->comment('Vibrant thumbnail for lobby'); + $table->enum('category', ['slots', 'plinko', 'wheel', 'cards', 'other'])->default('other')->comment('For filtering'); + $table->boolean('is_active')->default(true)->comment('Toggle for maintenance'); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('games'); + } +}; \ No newline at end of file diff --git a/database/migrations/2025_09_06_094001_create_promo_codes_table.php b/database/migrations/2025_09_06_094001_create_promo_codes_table.php new file mode 100644 index 0000000..803dd47 --- /dev/null +++ b/database/migrations/2025_09_06_094001_create_promo_codes_table.php @@ -0,0 +1,26 @@ +id(); + $table->string('code')->unique()->comment('Unique promo code, e.g., WELCOME100'); + $table->decimal('value', 15, 2)->comment('Skunk Coins awarded'); + $table->integer('uses_remaining')->default(-1)->comment('-1 for unlimited'); + $table->timestamp('expires_at')->nullable()->comment('Expiration date'); + $table->boolean('is_active')->default(true); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('promo_codes'); + } +}; \ No newline at end of file diff --git a/database/migrations/2025_09_06_094025_create_promo_code_redemptions_table.php b/database/migrations/2025_09_06_094025_create_promo_code_redemptions_table.php new file mode 100644 index 0000000..01d7013 --- /dev/null +++ b/database/migrations/2025_09_06_094025_create_promo_code_redemptions_table.php @@ -0,0 +1,24 @@ +id(); + $table->foreignId('promo_code_id')->constrained()->cascadeOnDelete(); + $table->foreignId('user_id')->constrained()->cascadeOnDelete(); + $table->timestamp('redeemed_at'); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('promo_code_redemptions'); + } +}; \ No newline at end of file diff --git a/database/migrations/2025_09_06_094041_create_audit_logs_table.php b/database/migrations/2025_09_06_094041_create_audit_logs_table.php new file mode 100644 index 0000000..412bb60 --- /dev/null +++ b/database/migrations/2025_09_06_094041_create_audit_logs_table.php @@ -0,0 +1,25 @@ +id(); + $table->foreignId('user_id')->nullable()->constrained()->cascadeOnDelete()->comment('Admin or player who performed action'); + $table->string('action')->comment('E.g., "updated_user_balance"'); + $table->json('details')->nullable()->comment('Before/after changes'); + $table->string('ip_address')->nullable(); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('audit_logs'); + } +}; \ No newline at end of file diff --git a/database/migrations/2025_09_06_094052_create_player_stats_table.php b/database/migrations/2025_09_06_094052_create_player_stats_table.php new file mode 100644 index 0000000..6aed9d2 --- /dev/null +++ b/database/migrations/2025_09_06_094052_create_player_stats_table.php @@ -0,0 +1,29 @@ +id(); + $table->foreignId('user_id')->constrained()->cascadeOnDelete(); + $table->foreignId('game_id')->nullable()->constrained()->cascadeOnDelete()->comment('Null for overall stats'); + $table->decimal('total_winnings', 15, 2)->default(0.00); + $table->decimal('total_bets', 15, 2)->default(0.00); + $table->integer('play_count')->default(0); + $table->decimal('daily_play_amount', 15, 2)->default(0.00)->comment('Bets in last 24 hours'); + $table->integer('win_streak')->default(0); + $table->timestamp('last_played_at')->nullable(); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('player_stats'); + } +}; \ No newline at end of file