secure() ? 'https' : 'http'; return "{$scheme}://{$subdomain}.{$baseDomain}"; } /** * Get origin URL (non-CDN). * * Useful when you need the direct URL without CDN. * * @param string $path Asset path */ public static function origin(string $path): string { return asset($path); } /** * Build the full URL for a path. */ protected static function buildUrl(string $path): string { // If CDN is disabled, use standard asset helper if (! self::isEnabled()) { return asset($path); } $baseUrl = self::getBaseUrl(); $path = ltrim($path, '/'); return "{$baseUrl}/{$path}"; } /** * Get file version hash for cache busting. */ protected static function getFileVersion(string $path): string { $fullPath = public_path($path); if (file_exists($fullPath)) { return substr(md5_file($fullPath), 0, 8); } // Fallback to app version return substr(md5(config('app.version', '1.0.0')), 0, 8); } }