diff --git a/app/Providers/Filament/AdminPanelProvider.php b/app/Providers/Filament/AdminPanelProvider.php index 6694332..c6a2cd6 100644 --- a/app/Providers/Filament/AdminPanelProvider.php +++ b/app/Providers/Filament/AdminPanelProvider.php @@ -23,19 +23,17 @@ class AdminPanelProvider extends PanelProvider public function panel(Panel $panel): Panel { return $panel - ->default() ->id('admin') ->path('admin') - ->login() ->colors([ 'primary' => Color::Amber, ]) - ->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources') - ->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages') + ->discoverResources(in: app_path('Filament/Admin/Resources'), for: 'App\\Filament\\Admin\\Resources') + ->discoverPages(in: app_path('Filament/Admin/Pages'), for: 'App\\Filament\\Admin\\Pages') ->pages([ Pages\Dashboard::class, ]) - ->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets') + ->discoverWidgets(in: app_path('Filament/Admin/Widgets'), for: 'App\\Filament\\Admin\\Widgets') ->widgets([ Widgets\AccountWidget::class, Widgets\FilamentInfoWidget::class, diff --git a/database/migrations/2025_09_02_210000_add_custom_fields_to_users_table.php b/database/migrations/2025_09_02_210000_add_custom_fields_to_users_table.php new file mode 100644 index 0000000..45d8f1e --- /dev/null +++ b/database/migrations/2025_09_02_210000_add_custom_fields_to_users_table.php @@ -0,0 +1,27 @@ +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']); + }); + } +}; \ No newline at end of file diff --git a/database/migrations/2025_09_02_210001_create_transactions_table.php b/database/migrations/2025_09_02_210001_create_transactions_table.php new file mode 100644 index 0000000..963de04 --- /dev/null +++ b/database/migrations/2025_09_02_210001_create_transactions_table.php @@ -0,0 +1,25 @@ +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'); + } +}; \ No newline at end of file diff --git a/database/migrations/2025_09_02_210002_create_promo_codes_table.php b/database/migrations/2025_09_02_210002_create_promo_codes_table.php new file mode 100644 index 0000000..81dba49 --- /dev/null +++ b/database/migrations/2025_09_02_210002_create_promo_codes_table.php @@ -0,0 +1,26 @@ +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'); + } +}; \ No newline at end of file diff --git a/database/migrations/2025_09_02_210003_create_site_settings_table.php b/database/migrations/2025_09_02_210003_create_site_settings_table.php new file mode 100644 index 0000000..ba647ae --- /dev/null +++ b/database/migrations/2025_09_02_210003_create_site_settings_table.php @@ -0,0 +1,23 @@ +id(); + $table->string('key')->unique(); + $table->string('value'); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('site_settings'); + } +}; \ No newline at end of file diff --git a/database/migrations/2025_09_02_210004_create_audit_logs_table.php b/database/migrations/2025_09_02_210004_create_audit_logs_table.php new file mode 100644 index 0000000..fe1a485 --- /dev/null +++ b/database/migrations/2025_09_02_210004_create_audit_logs_table.php @@ -0,0 +1,24 @@ +id(); + $table->foreignId('user_id')->nullable()->constrained(); + $table->string('action'); + $table->json('details')->nullable(); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('audit_logs'); + } +}; \ No newline at end of file diff --git a/database/migrations/2025_09_02_210005_create_chats_table.php b/database/migrations/2025_09_02_210005_create_chats_table.php new file mode 100644 index 0000000..c570944 --- /dev/null +++ b/database/migrations/2025_09_02_210005_create_chats_table.php @@ -0,0 +1,24 @@ +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'); + } +}; \ No newline at end of file diff --git a/database/migrations/2025_09_02_210006_create_games_table.php b/database/migrations/2025_09_02_210006_create_games_table.php new file mode 100644 index 0000000..97a20fb --- /dev/null +++ b/database/migrations/2025_09_02_210006_create_games_table.php @@ -0,0 +1,27 @@ +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'); + } +}; \ No newline at end of file diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index e2911a9..c7cf4a4 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -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', + ]); } } \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index c5a1a3e..abdc987 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,3 @@ -version: '3.8' services: app: build: .