55 lines
1.8 KiB
PHP
55 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use App\Models\User;
|
|
use App\Models\Wallet;
|
|
use App\Models\Game;
|
|
use App\Models\PromoCode;
|
|
use Spatie\Permission\Models\Role;
|
|
|
|
class DatabaseSeeder extends Seeder
|
|
{
|
|
public function run(): void
|
|
{
|
|
// Roles (Spatie)
|
|
Role::create(['name' => 'admin']);
|
|
Role::create(['name' => 'player']);
|
|
Role::create(['name' => 'vip']);
|
|
|
|
// Test User (Player)
|
|
$player = User::factory()->create([
|
|
'name' => 'Test Player',
|
|
'email' => 'player@skunklounge.com',
|
|
'password' => bcrypt('password'),
|
|
'is_kyc_verified' => true,
|
|
'vip_level' => 1,
|
|
]);
|
|
$player->assignRole('player', 'vip');
|
|
|
|
// Test Admin
|
|
$admin = User::factory()->create([
|
|
'name' => 'Test Admin',
|
|
'email' => 'admin@skunklounge.com',
|
|
'password' => bcrypt('password'),
|
|
'is_kyc_verified' => true,
|
|
'vip_level' => 0,
|
|
]);
|
|
$admin->assignRole('admin');
|
|
|
|
// Wallets
|
|
Wallet::create(['user_id' => $player->id, 'balance' => 10000.00]);
|
|
Wallet::create(['user_id' => $admin->id, 'balance' => 0.00]);
|
|
|
|
// Games
|
|
Game::create(['name' => 'Plinko', 'slug' => 'plinko', 'thumbnail_url' => 'https://placehold.co/300x200', 'category' => 'plinko']);
|
|
Game::create(['name' => 'Slots', 'slug' => 'slots', 'thumbnail_url' => 'https://placehold.co/300x200', 'category' => 'slots']);
|
|
|
|
// Promo Codes
|
|
PromoCode::create(['code' => 'WELCOME100', 'value' => 100.00, 'uses_remaining' => -1, 'is_active' => true]);
|
|
|
|
// Player Stats (initial)
|
|
\App\Models\PlayerStats::create(['user_id' => $player->id, 'total_winnings' => 0.00, 'total_bets' => 0.00, 'play_count' => 0]);
|
|
}
|
|
} |