argument('name'); // Generate key in format betix_{64 hex chars} $licenseKey = 'betix_' . bin2hex(random_bytes(32)); $ipWhitelist = array_filter($this->option('ip')); $domainWhitelist = array_filter($this->option('domain')); $casino = OperatorCasino::create([ 'name' => $name, 'license_key_hash' => hash('sha256', $licenseKey), 'status' => 'active', 'ip_whitelist' => !empty($ipWhitelist) ? array_values($ipWhitelist) : null, 'domain_whitelist' => !empty($domainWhitelist) ? array_values($domainWhitelist) : null, ]); $this->newLine(); $this->components->success("Operator casino created: [{$casino->id}] {$casino->name}"); $this->newLine(); $this->components->warn('⚠ Save this license key — it will NOT be shown again:'); $this->line(''); $this->line(" {$licenseKey}"); $this->line(''); if (!empty($casino->ip_whitelist)) { $this->line('IP whitelist: ' . implode(', ', $casino->ip_whitelist)); } if (!empty($casino->domain_whitelist)) { $this->line('Domain whitelist: ' . implode(', ', $casino->domain_whitelist)); } $this->newLine(); return self::SUCCESS; } }