finish off for today
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->string('role')->default('user');
|
||||
$table->decimal('balance', 10, 2)->default(0.00);
|
||||
$table->enum('account_status', ['active', 'suspended', 'banned'])->default('active');
|
||||
$table->enum('kyc_status', ['pending', 'verified', 'rejected'])->default('pending');
|
||||
$table->string('kyc_document_path')->nullable(); // For future KYC file uploads
|
||||
$table->timestamp('last_login')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn(['role', 'balance', 'account_status', 'kyc_status', 'kyc_document_path', 'last_login']);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('transactions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
|
||||
$table->enum('type', ['win', 'loss', 'deposit', 'withdraw', 'promo', 'adjustment']);
|
||||
$table->decimal('amount', 10, 2);
|
||||
$table->string('description')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('transactions');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('promo_codes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('code')->unique();
|
||||
$table->decimal('value', 10, 2);
|
||||
$table->boolean('used')->default(false);
|
||||
$table->foreignId('user_id')->nullable()->constrained();
|
||||
$table->timestamp('expires_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('promo_codes');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('site_settings', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('key')->unique();
|
||||
$table->string('value');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('site_settings');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('audit_logs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->nullable()->constrained();
|
||||
$table->string('action');
|
||||
$table->json('details')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('audit_logs');
|
||||
}
|
||||
};
|
||||
24
database/migrations/2025_09_02_210005_create_chats_table.php
Normal file
24
database/migrations/2025_09_02_210005_create_chats_table.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('chats', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('room'); // e.g., 'lobby' or 'game_1'
|
||||
$table->foreignId('user_id')->constrained();
|
||||
$table->text('message');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('chats');
|
||||
}
|
||||
};
|
||||
27
database/migrations/2025_09_02_210006_create_games_table.php
Normal file
27
database/migrations/2025_09_02_210006_create_games_table.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('games', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->boolean('enabled')->default(true);
|
||||
$table->decimal('win_probability', 5, 2)->default(50.00);
|
||||
$table->decimal('min_bet', 10, 2)->default(1.00);
|
||||
$table->decimal('max_bet', 10, 2)->default(100.00);
|
||||
$table->text('description')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('games');
|
||||
}
|
||||
};
|
||||
@@ -4,28 +4,46 @@ namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use App\Models\User;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
// Seed admin user
|
||||
// Seed admin user (for first-time admin)
|
||||
User::create([
|
||||
'name' => 'Admin',
|
||||
'email' => 'admin@skunklounge.com',
|
||||
'password' => Hash::make('securepass123'),
|
||||
'role' => 'admin',
|
||||
'balance' => 1000.00,
|
||||
'account_status' => 'active',
|
||||
'kyc_status' => 'verified',
|
||||
]);
|
||||
|
||||
// Other seeds (e.g., site settings, promos) as before
|
||||
\DB::table('site_settings')->insert([
|
||||
// Seed site settings
|
||||
DB::table('site_settings')->insert([
|
||||
['key' => 'currency_symbol', 'value' => '$'],
|
||||
['key' => 'default_balance', 'value' => '0.00'],
|
||||
['key' => 'default_balance', 'value' => '100.00'],
|
||||
['key' => 'maintenance_mode', 'value' => 'false'],
|
||||
]);
|
||||
\DB::table('promo_codes')->insert(['code' => 'START100', 'value' => 100.00]);
|
||||
|
||||
// Seed promo code
|
||||
DB::table('promo_codes')->insert([
|
||||
'code' => 'START100',
|
||||
'value' => 100.00,
|
||||
]);
|
||||
|
||||
// Seed sample game
|
||||
DB::table('games')->insert([
|
||||
'name' => 'Slots',
|
||||
'enabled' => true,
|
||||
'win_probability' => 50.00,
|
||||
'min_bet' => 1.00,
|
||||
'max_bet' => 100.00,
|
||||
'description' => 'Pragmatic Play-style slots',
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user