Files

1 line
35 KiB
JSON

{"repo": "aotr/dynamic-levels-helper", "files": {"src/config/dynamic-levels-helper-sms.php": {"806cae66ff05a4f75186c5b83d75292f32f830c8": {"t": 1785595519.5567675, "n": 1790, "h": "16c9da996c909b31", "c": "<?php\n\nreturn [\n 'default_provider' => env('SMS_PROVIDER', 'myvaluefirst'),\n\n 'providers' => [\n 'sinfini' => [\n 'url' => env('SINFINI_URL'),\n 'format' => [\n 'method' => 'sms',\n 'api_key' => env('SINFINI_API_KEY'),\n 'to' => '',\n 'sender' => env('SINFINI_SENDER'),\n 'message' => '',\n 'custom' => '',\n 'flash' => env('SINFINI_FLASH', '0'),\n ],\n ],\n\n 'onex' => [\n 'url' => env('ONEX_URL'),\n 'format' => [\n 'username' => env('ONEX_USERNAME'),\n 'password' => env('ONEX_PASSWORD'),\n 'to' => '',\n 'from' => env('ONEX_FROM'),\n 'text' => '',\n ],\n ],\n\n 'myvaluefirst' => [\n 'url' => env('MYVALUEFIRST_URL'),\n 'format' => [\n 'username' => env('MYVALUEFIRST_USERNAME'),\n 'password' => env('MYVALUEFIRST_PASSWORD'),\n 'to' => '',\n 'from' => env('MYVALUEFIRST_FROM'),\n 'text' => '',\n 'dlr-mask' => env('MYVALUEFIRST_DLR_MASK', '19'),\n ],\n ],\n\n 'infobip' => [\n 'url' => env('INFOBIP_URL'),\n 'api_url' => env('INFOBIP_API_URL'),\n 'format' => [\n 'username' => env('INFOBIP_USERNAME'),\n 'password' => env('INFOBIP_PASSWORD'),\n 'indiaDltContentTemplateId' => env('INFOBIP_DLT_TEMPLATE_ID'),\n 'indiaDltPrincipalEntityId' => env('INFOBIP_DLT_ENTITY_ID'),\n 'to' => '',\n 'from' => env('INFOBIP_FROM'),\n 'text' => '',\n ],\n ],\n ],\n];\n"}}, "README.md": {"806cae66ff05a4f75186c5b83d75292f32f830c8": {"t": 1785595520.3916526, "n": 32399, "h": "856ab20366ce3142", "c": "# Dynamic Levels Helper\n\nA comprehensive Laravel package that provides enterprise-grade tools for database operations, SMS services, WhatsApp integration, geo-data management, icon systems, and more.\n\n## 🚀 Features\n\n### Core Services\n- **Enhanced Database Service**: Singleton pattern with connection pooling, performance monitoring, and configurable logging\n- **SMS Service**: Multi-provider support (Sinfini, Onex, MyValueFirst, Infobip)\n- **WhatsApp Integration**: Structured messaging with GoInfinito provider\n- **TOON Service**: Token-Optimized Object Notation encoder/decoder for AI/LLM applications\n- **Geo Data Service**: Automatic syncing of countries, states, and cities from GitHub repository\n- **Lucide Icon System**: SVG icon caching and Blade component integration\n- **Parameter Service**: Efficient request parameter processing with multiple formats\n- **Amount Format Helper**: Indian currency formatting with comprehensive options and Blade directives\n- **Cache Service**: Advanced caching with invalidation and refresh capabilities\n\n### Developer Tools\n- **Response Macros**: Standardized API response formats\n- **Basic Auth Middleware**: Simple HTTP basic auth protection\n- **Console Commands**: Comprehensive management and monitoring tools\n- **Blade Components**: Ready-to-use UI components\n\n\n## 📋 Requirements\n\n- PHP 8.1 or higher\n- Laravel 10.x, 11.x, or 12.x\n- Composer\n\n## 📦 Installation\n\n```bash\ncomposer require aotr/dynamic-levels-helper\n```\n\n## ⚙️ Configuration\n\nPublish all configuration files:\n\n```bash\n# Publish all configs at once\nphp artisan vendor:publish --provider=\"Aotr\\DynamicLevelHelper\\Providers\\DynamicLevelHelperServiceProvider\"\n\n# Or publish specific configs\nphp artisan vendor:publish --tag=dynamic-levels-helper-config\nphp artisan vendor:publish --tag=dynamic-levels-helper-sms-config\nphp artisan vendor:publish --tag=dynamic-levels-helper-whatsapp-config\nphp artisan vendor:publish --tag=toon-config\nphp artisan vendor:publish --tag=lucide-config\nphp artisan vendor:publish --tag=dynamic-levels-helper-scripts\n```\n\n---\n\n## 📖 Feature Documentation\n\n### 🗄️ Enhanced Database Service\n\nEnterprise-grade database service with singleton pattern, connection pooling, and performance monitoring.\n\n#### Key Features\n- ✅ **Singleton Pattern**: Single instance for efficient resource management\n- ✅ **Connection Pooling**: Automatic connection management with configurable pool size\n- ✅ **Configurable Logging**: Flexible logging to different channels with granular control\n- ✅ **Performance Monitoring**: Query execution tracking and slow query detection\n- ✅ **Cached Procedure Checks**: Efficient stored procedure existence validation\n- ✅ **Automatic Retry Logic**: Built-in retry mechanism for failed connections\n- ✅ **Console Management**: Commands for monitoring and managing the service\n\n#### Basic Usage\n\n```php\nuse Aotr\\DynamicLevelHelper\\Services\\EnhancedDBService;\nuse Aotr\\DynamicLevelHelper\\Facades\\EnhancedDBService as DBServiceFacade;\n\n// Singleton instance\n$dbService = EnhancedDBService::getInstance();\n$results = $dbService->callStoredProcedure('my_procedure', [1, 'param2']);\n\n// Using facade\n$results = DBServiceFacade::callStoredProcedure('my_procedure', [1, 'param2']);\n\n// Advanced options\n$results = $dbService->callStoredProcedure('my_procedure', [1, 'param2'], [\n 'connection' => 'custom_connection',\n 'checkStoredProcedure' => true,\n 'timeout' => 60,\n]);\n```\n\n#### Monitoring & Management\n\n```bash\n# View connection pool statistics\nphp artisan db-service:manage stats\n\n# Monitor performance metrics\nphp artisan db-service:manage performance\n\n# View current configuration\nphp artisan db-service:manage config\n\n# Reset service connections\nphp artisan db-service:manage reset\n```\n\n#### Configuration\n\n```php\n// config/enhanced-db-service.php\n\nreturn [\n 'default_connection' => env('DB_SERVICE_DEFAULT_CONNECTION', 'mysql'),\n \n 'connection_pool' => [\n 'max_connections' => env('DB_SERVICE_MAX_CONNECTIONS', 10),\n 'pool_timeout' => env('DB_SERVICE_POOL_TIMEOUT', 30),\n 'idle_timeout' => env('DB_SERVICE_IDLE_TIMEOUT', 300),\n 'retry_attempts' => env('DB_SERVICE_RETRY_ATTEMPTS', 3),\n ],\n \n 'logging' => [\n 'enabled' => env('DB_SERVICE_LOGGING_ENABLED', true),\n 'channel' => env('DB_SERVICE_LOGGING_CHANNEL', 'stp'),\n 'log_queries' => env('DB_SERVICE_LOG_QUERIES', true),\n 'log_errors' => env('DB_SERVICE_LOG_ERRORS', true),\n 'log_execution_time' => env('DB_SERVICE_LOG_EXECUTION_TIME', true),\n ],\n \n 'performance' => [\n 'slow_query_threshold' => env('DB_SERVICE_SLOW_QUERY_THRESHOLD', 2.0),\n 'enable_query_profiling' => env('DB_SERVICE_ENABLE_PROFILING', false),\n ],\n];\n```\n\n#### Using DBDataService Trait\n\n```php\nuse Aotr\\DynamicLevelHelper\\Traits\\DBDataService;\n\nclass UserRepository\n{\n use DBDataService;\n \n protected string $dbConnection = 'mysql';\n protected string $stpConfigPath = 'dynamic-levels-helper-stp';\n \n public function getUserData($userId)\n {\n return $this->getData('Stp_GetUserData', [\n 'user_id' => $userId\n ]);\n }\n}\n```\n\n---\n\n### 🧠 TOON Service (Token-Optimized Object Notation)\n\nAdvanced encoding/decoding service for Token-Optimized Object Notation format, designed to reduce token consumption in AI/LLM applications while maintaining data integrity.\n\n#### Why TOON?\n- **Token Efficiency**: Up to 40-60% reduction in token count compared to JSON\n- **AI/LLM Optimized**: Specifically designed for language model contexts where token usage matters\n- **Data Integrity**: Maintains full data structure and type information\n- **Performance**: Fast encoding/decoding with built-in caching\n- **Laravel Native**: Full integration with Laravel's caching and logging systems\n\n#### Key Features\n- ✅ **Compact Format**: Significantly smaller than JSON for complex data structures\n- ✅ **Type Preservation**: Maintains PHP data types during encode/decode cycles\n- ✅ **Batch Operations**: Encode/decode multiple items efficiently\n- ✅ **Caching Support**: Built-in caching with configurable TTL\n- ✅ **Compression Analytics**: Real-time compression ratio statistics\n- ✅ **Laravel Integration**: Facades, service container, and config-driven\n\n#### Branch Compatibility\n- ✅ **master** - Laravel 12 (fully integrated and tested)\n- ✅ **main-for-12** - Laravel 12 (fully integrated and tested)\n- ✅ **main-for-10** - Laravel 10 (fully integrated and tested with compatibility fixes)\n\n#### Basic Usage\n\n```php\nuse Aotr\\DynamicLevelHelper\\Facades\\ToonService;\n\n// Encode data to TOON format\n$data = ['user' => 'John Doe', 'age' => 30, 'active' => true];\n$toonString = ToonService::encode($data);\n\n// Decode back to PHP array\n$originalData = ToonService::decode($toonString);\n\n// Work with Laravel Collections\n$collection = collect(['item1', 'item2', 'item3']);\n$encodedCollection = ToonService::encodeCollection($collection);\n$decodedCollection = ToonService::decodeToCollection($encodedCollection);\n```\n\n#### Compression Analysis\n\n```php\n// Get compression statistics compared to JSON\n$largeDataset = [\n 'users' => [...], // Large array of user data\n 'metadata' => [...],\n 'settings' => [...]\n];\n\n$stats = ToonService::getCompressionStats($largeDataset);\n/*\nReturns:\n[\n 'json_size' => 2547,\n 'toon_size' => 1423,\n 'compression_ratio' => 44.13, // 44% smaller than JSON\n 'size_difference' => 1124,\n 'json_encoded' => '{\"users\":[...]...}',\n 'toon_encoded' => 'u=[...]...' // Compact TOON format\n]\n*/\n```\n\n#### Batch Operations\n\n```php\n// Batch encode multiple data items\n$items = [\n ['name' => 'User 1', 'email' => 'user1@example.com'],\n ['name' => 'User 2', 'email' => 'user2@example.com'],\n ['name' => 'User 3', 'email' => 'user3@example.com']\n];\n\n$encoded = ToonService::batchEncode($items);\n$decoded = ToonService::batchDecode($encoded);\n```\n\n#### Caching Integration\n\n```php\n// Cache encoded data with automatic TOON encoding\n$cacheKey = 'user_preferences_123';\n$userData = ['theme' => 'dark', 'notifications' => true, 'language' => 'en'];\n\n// Encode and cache for 1 hour\n$encodedData = ToonService::cacheEncode($cacheKey, $userData, 3600);\n\n// Retrieve and decode from cache\n$cachedData = ToonService::getCached($cacheKey);\n```\n\n#### Use Cases\n\n**AI/LLM Applications**:\n```php\n// Before (JSON): 147 tokens\n$jsonPrompt = json_encode([\n 'context' => 'User analysis',\n 'data' => $userAnalytics,\n 'options' => ['detailed' => true, 'format' => 'summary']\n]);\n\n// After (TOON): ~85 tokens (42% reduction)\n$toonPrompt = ToonService::encode([\n 'context' => 'User analysis',\n 'data' => $userAnalytics,\n 'options' => ['detailed' => true, 'format' => 'summary']\n]);\n```\n\n**API Response Optimization**:\n```php\n// Compress API responses for mobile apps\nRoute::get('/api/dashboard', function () {\n $dashboardData = [\n 'user' => auth()->user(),\n 'stats' => DashboardService::getStats(),\n 'notifications' => NotificationService::getRecent()\n ];\n \n return response()->json([\n 'data' => ToonService::encode($dashboardData),\n 'format' => 'toon'\n ]);\n});\n```\n\n#### Configuration\n\n```php\n// config/toon.php\n\nreturn [\n 'cache' => [\n 'enabled' => env('TOON_CACHE_ENABLED', true),\n 'ttl' => [\n 'default' => env('TOON_CACHE_TTL_DEFAULT', 3600),\n 'encode' => env('TOON_CACHE_TTL_ENCODE', 7200),\n 'decode' => env('TOON_CACHE_TTL_DECODE', 7200),\n ],\n 'prefix' => env('TOON_CACHE_PREFIX', 'toon_'),\n ],\n \n 'logging' => [\n 'enabled' => env('TOON_LOGGING_ENABLED', false),\n 'channel' => env('TOON_LOG_CHANNEL', 'toon'),\n 'level' => env('TOON_LOG_LEVEL', 'info'),\n ],\n \n 'performance' => [\n 'max_string_length' => env('TOON_MAX_STRING_LENGTH', 1000000),\n 'enable_compression_stats' => env('TOON_ENABLE_COMPRESSION_STATS', true),\n ],\n \n 'features' => [\n 'batch_operations' => env('TOON_FEATURE_BATCH_OPERATIONS', true),\n 'caching' => env('TOON_FEATURE_CACHING', true),\n 'validation' => env('TOON_FEATURE_VALIDATION', true),\n ],\n];\n```\n\n#### Service Methods\n\n| Method | Description | Returns |\n|--------|-------------|---------|\n| `encode($data, $options)` | Encode data to TOON format | `string` |\n| `decode($toonString, $options)` | Decode TOON string back to PHP data | `mixed` |\n| `encodeArray($data, $options)` | Encode arrays specifically | `string` |\n| `encodeCollection($collection, $options)` | Encode Laravel collections | `string` |\n| `decodeToCollection($toonString, $options)` | Decode to Laravel collection | `Collection` |\n| `getCompressionStats($data)` | Get compression analysis vs JSON | `array` |\n| `batchEncode($items, $options)` | Encode multiple items | `array` |\n| `batchDecode($toonStrings, $options)` | Decode multiple TOON strings | `array` |\n| `cacheEncode($key, $data, $ttl, $options)` | Cache encoded data | `string` |\n| `getCached($key, $options)` | Retrieve cached data | `mixed` |\n| `isValidToon($toonString)` | Validate TOON format | `bool` |\n| `isAvailable()` | Check service availability | `bool` |\n| `getServiceInfo()` | Get service information | `array` |\n\n---\n\n### � Amount Format Helper\n\n**Purpose**: Comprehensive Indian currency formatting with extensive customization options.\n\nThe `amount_format()` helper provides professional-grade currency formatting following Indian numbering conventions (lakhs, crores) with flexible configuration for various display requirements.\n\n#### Key Features\n\n- **Indian Numbering System**: Proper comma placement (1,00,000 for 1 lakh, 1,00,00,000 for 1 crore)\n- **Currency Symbol Control**: Customizable symbol with position and spacing options\n- **Smart Decimal Handling**: Option to hide .00, configurable decimal places\n- **Negative Formatting**: Support for minus (-) or brackets () format\n- **Exception-Free**: Robust error handling with safe fallbacks\n- **Multiple Input Types**: Handles int, float, string, null gracefully\n- **Blade Directives**: Ready-to-use directives for templates\n\n#### Basic Usage\n\n```php\n// Basic formatting\namount_format(1000) // ₹1,000\namount_format(1234567.89) // ₹12,34,567.89\namount_format(1000.00) // ₹1,000 (hides .00)\n\n// Indian numbering\namount_format(100000) // ₹1,00,000 (1 Lakh)\namount_format(1000000) // ₹10,00,000 (10 Lakhs)\namount_format(10000000) // ₹1,00,00,000 (1 Crore)\n\n// Negative amounts\namount_format(-5000) // -₹5,000\namount_format(-5000, ['negative_format' => 'brackets']) // (₹5,000)\n```\n\n#### Advanced Configuration\n\n```php\n// Custom symbol and positioning\namount_format(1000, ['symbol' => 'Rs.', 'symbol_space' => true]) // Rs. 1,000\namount_format(1000, ['symbol' => 'USD', 'symbol_position' => 'after']) // 1,000USD\namount_format(1000, ['symbol' => '']) // 1,000 (no symbol)\n\n// Decimal control\namount_format(1000.00, ['hide_zero_decimals' => false]) // ₹1,000.00\namount_format(1234.56, ['decimals' => 0]) // ₹1,235 (rounded)\namount_format(1234.5678, ['decimals' => 3]) // ₹1,234.568\n\n// Custom separators\namount_format(1234.56, [\n 'decimal_separator' => ',',\n 'thousands_separator' => '.'\n]) // ₹1.234,56\n\n// Complex configuration\n$options = [\n 'symbol' => 'USD',\n 'decimals' => 3,\n 'symbol_position' => 'after',\n 'symbol_space' => true,\n 'negative_format' => 'brackets',\n 'hide_zero_decimals' => false\n];\namount_format(1234.567, $options) // 1,234.567 USD\namount_format(-1234.000, $options) // (1,234.000 USD)\n```\n\n#### Blade Directives\n\nThe package includes convenient Blade directives for template usage:\n\n```blade\n{{-- Basic currency formatting --}}\n@currency($amount) {{-- ₹1,000 --}}\n@rupee($amount) {{-- Alias for @currency --}}\n@amount($amount) {{-- 1,000 (no symbol) --}}\n@currencyWhole($amount) {{-- ₹1,000 (no decimals) --}}\n@currencyWithOptions($amount, $opts) {{-- With custom options --}}\n\n{{-- Examples in templates --}}\n<span class=\"price\">@currency($product->price)</span>\n<div class=\"total\">Total: @currency($order->total)</div>\n<p>Savings: @currency($discount, ['symbol' => '', 'decimals' => 0])</p>\n```\n\n#### Configuration Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `symbol` | string | '₹' | Currency symbol (use '' for none) |\n| `decimals` | int | 2 | Number of decimal places |\n| `hide_zero_decimals` | bool | true | Hide .00 decimals |\n| `decimal_separator` | string | '.' | Decimal separator character |\n| `thousands_separator` | string | ',' | Thousands separator character |\n| `symbol_position` | string | 'before' | 'before' or 'after' |\n| `symbol_space` | bool | false | Add space between symbol and amount |\n| `negative_format` | string | 'minus' | 'minus' (-₹1,000) or 'brackets' ((₹1,000)) |\n\n#### Error Handling\n\n```php\n// All inputs are handled safely\namount_format(null) // ₹0\namount_format('') // ₹0\namount_format('invalid') // ₹0\namount_format('1000.50') // ₹1,000.50 (string parsing)\namount_format('₹1,000') // ₹1,000 (already formatted)\n```\n\n#### Use Cases\n\n- **E-commerce**: Product pricing, order totals, discounts\n- **Financial Applications**: Account balances, transaction amounts\n- **Reports**: Financial statements, invoices, receipts \n- **Dashboards**: Revenue displays, KPI formatting\n- **APIs**: Consistent currency formatting in responses\n\n#### Performance\n\n- Optimized for high-frequency usage\n- Exception-free with comprehensive error handling\n- Minimal memory footprint\n- Fast Indian numbering algorithm\n\n---\n\n### �📱 SMS Service\n\nMulti-provider SMS service with support for major SMS gateways.\n\n#### Supported Providers\n- **Sinfini** - SMS gateway provider\n- **Onex** - SMS service provider\n- **MyValueFirst** - Enterprise SMS solutions\n- **Infobip** - Global communications platform\n\n#### Basic Usage\n\n```php\nuse Aotr\\DynamicLevelHelper\\Services\\SMS\\SmsService;\n\n$smsService = app(SmsService::class);\n\n// Send SMS\n$success = $smsService->sendSms(\n phoneNumber: '1234567890',\n message: 'Your OTP is 123456',\n countryCode: 91\n);\n\nif ($success) {\n echo \"SMS sent successfully!\";\n}\n```\n\n#### Configuration\n\n```php\n// config/dynamic-levels-helper-sms.php\n\nreturn [\n 'default_provider' => env('SMS_PROVIDER', 'myvaluefirst'),\n \n 'providers' => [\n 'sinfini' => [\n 'url' => env('SINFINI_URL'),\n 'format' => [\n 'api_key' => env('SINFINI_API_KEY'),\n 'sender' => env('SINFINI_SENDER'),\n // ... more config\n ],\n ],\n \n 'myvaluefirst' => [\n 'url' => env('MYVALUEFIRST_URL'),\n 'format' => [\n 'username' => env('MYVALUEFIRST_USERNAME'),\n 'password' => env('MYVALUEFIRST_PASSWORD'),\n 'from' => env('MYVALUEFIRST_FROM'),\n 'dlr-mask' => env('MYVALUEFIRST_DLR_MASK', '19'),\n ],\n ],\n \n 'infobip' => [\n 'url' => env('INFOBIP_URL'),\n 'format' => [\n 'username' => env('INFOBIP_USERNAME'),\n 'password' => env('INFOBIP_PASSWORD'),\n 'indiaDltContentTemplateId' => env('INFOBIP_DLT_TEMPLATE_ID'),\n 'indiaDltPrincipalEntityId' => env('INFOBIP_DLT_ENTITY_ID'),\n ],\n ],\n ],\n];\n```\n\n#### Environment Variables\n\n```env\nSMS_PROVIDER=myvaluefirst\n\n# MyValueFirst Configuration\nMYVALUEFIRST_URL=https://api.myvaluefirst.com/psms/servlet/psms.Sendmsg?\nMYVALUEFIRST_USERNAME=your_username\nMYVALUEFIRST_PASSWORD=your_password\nMYVALUEFIRST_FROM=SENDERID\nMYVALUEFIRST_DLR_MASK=19\n\n# Infobip Configuration\nINFOBIP_URL=https://api.infobip.com/sms/1/text/single\nINFOBIP_USERNAME=your_username\nINFOBIP_PASSWORD=your_password\nINFOBIP_DLT_TEMPLATE_ID=your_template_id\nINFOBIP_DLT_ENTITY_ID=your_entity_id\n```\n\n---\n\n### 💬 WhatsApp Service\n\nStructured WhatsApp messaging integration with GoInfinito provider.\n\n#### Basic Usage\n\n```php\nuse Aotr\\DynamicLevelHelper\\Services\\WhatsAppSdk\\WhatsAppService;\nuse Aotr\\DynamicLevelHelper\\Services\\WhatsAppSdk\\Messages\\TextMessage;\n\n$whatsAppService = new WhatsAppService();\n\n// Create a text message\n$message = new TextMessage(\n to: '919876543210',\n message: 'Hello from Laravel!'\n);\n\n// Send the message\n$response = $whatsAppService->send($message);\n```\n\n#### Message Types\n\n```php\n// Text Message\n$textMessage = new TextMessage(\n to: '919876543210',\n message: 'Your order has been confirmed!'\n);\n\n// Template Message (if supported)\n$templateMessage = new TemplateMessage(\n to: '919876543210',\n templateId: 'order_confirmation',\n parameters: ['John', 'ORD123']\n);\n```\n\n#### Configuration\n\n```php\n// config/dynamic-levels-helper-whatsapp.php\n\nreturn [\n 'default_provider' => env('WHATSAPP_PROVIDER', 'goinfinito'),\n \n 'goinfinito' => [\n 'api_url' => env('GOINFINITO_API_URL', 'https://api.goinfinito.com/unified/v2/send'),\n 'api_token' => env('GOINFINITO_API_TOKEN'),\n 'from_number' => env('GOINFINITO_FROM_NUMBER'),\n ],\n];\n```\n\n#### Environment Variables\n\n```env\nWHATSAPP_PROVIDER=goinfinito\nGOINFINITO_API_URL=https://api.goinfinito.com/unified/v2/send\nGOINFINITO_API_TOKEN=your_api_token\nGOINFINITO_FROM_NUMBER=your_whatsapp_number\n```\n\n---\n\n### 🌍 Geo Data Service\n\nAutomatic syncing and caching of geographical data (countries, states, cities) from GitHub repository.\n\n#### Features\n- ✅ Automatic download of geo JSON files\n- ✅ Gzip fallback for large files\n- ✅ Streaming downloads for memory efficiency\n- ✅ Built-in caching for fast access\n- ✅ Multiple data formats (countries, states, cities, regions)\n- ✅ Bash script alternative for memory-constrained environments\n\n#### Basic Usage\n\n```php\nuse Aotr\\DynamicLevelHelper\\Services\\GeoDataService;\nuse Aotr\\DynamicLevelHelper\\Facades\\GeoDataService as GeoData;\n\n$geoService = app(GeoDataService::class);\n\n// Sync all data from GitHub\n$geoService->sync();\n\n// Get countries\n$countries = $geoService->getCountries();\n\n// Get countries with states\n$countriesStates = $geoService->getCountriesWithStates();\n\n// Get cities\n$cities = $geoService->getCities();\n\n// Get countries with cities\n$countriesCities = $geoService->getCountriesWithCities();\n\n// Get complete data\n$allData = $geoService->getCountriesStatesCities();\n\n// Get regions\n$regions = $geoService->getRegions();\n\n// Get states\n$states = $geoService->getStates();\n```\n\n#### Artisan Commands\n\n```bash\n# Sync geo data files\nphp artisan sync:countries-states-json\n\n# Manage geo data sync script\nphp artisan geo:script install # Install bash script\nphp artisan geo:script run # Run the sync script\nphp artisan geo:script status # Check script status\nphp artisan geo:script uninstall # Remove script\n```\n\n#### Memory-Efficient Bash Script\n\nFor servers with limited memory, use the bash script:\n\n```bash\n# Install the script\nphp artisan geo:script install\n\n# Run the script directly\nbash scripts/sync-geo-data.sh\n\n# Or via artisan\nphp artisan geo:script run\n```\n\n#### Data Structure Example\n\n```php\n// Countries data structure\n[\n [\n 'id' => 1,\n 'name' => 'India',\n 'iso2' => 'IN',\n 'iso3' => 'IND',\n 'phone_code' => '91',\n 'capital' => 'New Delhi',\n 'currency' => 'INR',\n 'states' => [...] // When using getCountriesWithStates()\n ],\n // ... more countries\n]\n```\n\n---\n\n### 🎨 Lucide Icon System\n\nSVG icon caching system with Blade component integration for [Lucide Icons](https://lucide.dev/).\n\n#### Features\n- ✅ Automatic icon fetching from CDN\n- ✅ Local caching for performance\n- ✅ Blade component integration\n- ✅ Customizable attributes\n- ✅ Artisan commands for management\n- ✅ Graceful conflict handling\n\n#### Basic Usage\n\n```blade\n{{-- Basic icon --}}\n<x-lucide-icon name=\"check\" />\n\n{{-- Icon with size --}}\n<x-lucide-icon name=\"arrow-right\" size=\"24\" />\n\n{{-- Icon with Tailwind classes --}}\n<x-lucide-icon name=\"alert-circle\" class=\"w-6 h-6 text-red-500\" />\n\n{{-- Icon with custom attributes --}}\n<x-lucide-icon \n name=\"settings\" \n size=\"32\" \n stroke=\"#333\" \n stroke-width=\"1.5\" \n class=\"hover:text-blue-500\"\n/>\n\n{{-- Icon with color alias --}}\n<x-lucide-icon name=\"heart\" color=\"red\" size=\"20\" />\n```\n\n#### Programmatic Usage\n\n```php\nuse Aotr\\DynamicLevelHelper\\Services\\LucideIconService;\n\n$iconService = app(LucideIconService::class);\n\n// Get icon with attributes\n$svg = $iconService->getIcon('check', [\n 'class' => 'w-6 h-6',\n 'stroke' => 'currentColor'\n]);\n\n// Cache icons\n$iconService->cache('check');\n$iconService->cache('arrow-right', force: true);\n\n// Cache multiple icons\n$results = $iconService->cacheMany(['check', 'download', 'upload']);\n\n// Check if icon exists\nif ($iconService->exists('check')) {\n // Icon is cached\n}\n\n// Get all cached icons\n$cachedIcons = $iconService->getCachedIcons();\n\n// Clear cache\n$iconService->clearCache();\n```\n\n#### Artisan Commands\n\n```bash\n# Cache single icon\nphp artisan lucide:cache check\n\n# Cache multiple icons\nphp artisan lucide:cache --list=check,download,arrow-right\n\n# Force re-download\nphp artisan lucide:cache check --force\n\n# Show cache status\nphp artisan lucide:cache --status\n\n# Clear all cached icons\nphp artisan lucide:cache --clear\n```\n\n#### Configuration\n\n```php\n// config/lucide.php\n\nreturn [\n 'icon_storage_disk' => env('LUCIDE_STORAGE_DISK', 'local'),\n 'icon_storage_path' => env('LUCIDE_STORAGE_PATH', 'lucide/icons'),\n 'remote_source' => env('LUCIDE_REMOTE_SOURCE', \n 'https://unpkg.com/lucide-static@latest/icons/{icon}.svg'\n ),\n 'cache_ttl' => env('LUCIDE_CACHE_TTL', 86400),\n \n 'default_attributes' => [\n 'stroke' => 'currentColor',\n 'stroke-width' => '2',\n 'stroke-linecap' => 'round',\n 'stroke-linejoin' => 'round',\n 'fill' => 'none',\n ],\n];\n```\n\n#### Available Attributes\n\n- `name` (required) - Icon name in kebab-case\n- `size` - Sets both width and height\n- `stroke` or `color` - Stroke color\n- `stroke-width` or `strokeWidth` - Stroke width\n- `stroke-linecap` or `strokeLinecap` - Stroke linecap style\n- `stroke-linejoin` or `strokeLinejoin` - Stroke linejoin style\n- `fill` - Fill color\n- `class` - CSS classes\n\n---\n\n### 🔧 Parameter Service\n\nEfficient parameter processing service for converting request data into formatted strings.\n\n#### Basic Usage\n\n```php\nuse Aotr\\DynamicLevelHelper\\Services\\ParameterService;\nuse Aotr\\DynamicLevelHelper\\Facades\\ParameterService as Params;\n\n// Process request data with default delimiter (^^)\n$params = ParameterService::process($request);\n\n// Process with custom delimiter\n$params = ParameterService::process($request, delimiter: '||');\n\n// Process specific keys in order\n$params = ParameterService::process($request, sequence: ['user_id', 'email', 'phone']);\n\n// Simple processing (quick method)\n$params = ParameterService::quick($request, ['user_id', 'email']);\n\n// Using facade\n$params = Params::process($request->all());\n```\n\n#### Advanced Examples\n\n```php\n// From array data\n$data = [\n 'user_id' => 123,\n 'email' => 'user@example.com',\n 'phone' => '1234567890'\n];\n\n$formatted = ParameterService::process($data);\n// Output: \"123^^user@example.com^^1234567890\"\n\n// With specific sequence\n$formatted = ParameterService::process($data, sequence: ['phone', 'email']);\n// Output: \"1234567890^^user@example.com\"\n\n// Custom delimiter\n$formatted = ParameterService::process($data, delimiter: '|');\n// Output: \"123|user@example.com|1234567890\"\n\n// From Laravel Request\n$formatted = ParameterService::process($request, \n sequence: ['name', 'email', 'phone'],\n delimiter: '^^'\n);\n\n// Handle nested keys\n$formatted = ParameterService::process([\n 'user' => ['id' => 1, 'name' => 'John'],\n 'order' => ['id' => 100]\n], sequence: ['user.id', 'user.name', 'order.id']);\n// Output: \"1^^John^^100\"\n```\n\n#### Use Cases\n\n```php\n// For stored procedures\n$params = ParameterService::process($request, \n sequence: ['country_code', 'phone', 'platform', 'device_id']\n);\n$result = $dbService->callStoredProcedure('Stp_Request_OTP', [$params]);\n\n// For API integrations\n$apiParams = ParameterService::process($data, delimiter: '&');\n\n// For CSV-like formats\n$csvRow = ParameterService::process($data, delimiter: ',');\n```\n\n---\n\n### 💾 Cache Service\n\nAdvanced caching service with TTL management and cache invalidation.\n\n#### Basic Usage\n\n```php\nuse Aotr\\DynamicLevelHelper\\Services\\CacheService;\n\n$cacheService = new CacheService();\n\n// Generate cache key from data\n$key = $cacheService->generateCacheKey([\n 'user_id' => 123,\n 'type' => 'profile'\n]);\n\n// Store data\n$cacheService->putCache($key, $data, ttl: 3600);\n\n// Retrieve data\n$cachedData = $cacheService->getCache($key);\n\n// Invalidate cache\n$cacheService->invalidateCache($key);\n\n// Refresh cache with new data\n$cacheService->refreshCache($key, $newData, ttl: 7200);\n```\n\n---\n\n### 📡 Response Macros\n\nStandardized API response formats for consistent API responses.\n\n#### Basic Usage\n\n```php\n// Success response\nreturn response()->api($data);\n// Output: { \"error\": 0, \"errmsg\": \"\", \"response\": {...} }\n\n// Processed response (filters and transforms)\nreturn response()->apiProcess($data);\n\n// Error response\nreturn response()->apiError('User not found', 1001);\n// Output: { \"error\": 1001, \"errmsg\": \"User not found\", \"response\": [] }\n\n// Custom error response\nreturn response()->apiError(\n message: 'Validation failed',\n errorCode: 422,\n data: ['field' => 'email', 'error' => 'Invalid email']\n);\n```\n\n#### Response Structure\n\nAll responses follow this structure:\n```json\n{\n \"error\": 0,\n \"errmsg\": \"\",\n \"response\": {},\n \"request\": {}\n}\n```\n\n---\n\n### 🔐 Basic Auth Middleware\n\nSimple HTTP basic authentication middleware.\n\n#### Usage\n\n```php\n// In routes/web.php or routes/api.php\nRoute::middleware('dynamic.basic.auth')->group(function () {\n Route::get('/admin/dashboard', [AdminController::class, 'index']);\n Route::get('/admin/users', [AdminController::class, 'users']);\n});\n\n// Single route\nRoute::get('/admin/settings', [AdminController::class, 'settings'])\n ->middleware('dynamic.basic.auth');\n```\n\n#### Configuration\n\n```php\n// config/dynamic-levels-helper.php\nreturn [\n 'basic_auth_username' => env('BASIC_AUTH_USERNAME', 'admin'),\n 'basic_auth_password' => env('BASIC_AUTH_PASSWORD', 'secret'),\n];\n```\n\n```env\nBASIC_AUTH_USERNAME=admin\nBASIC_AUTH_PASSWORD=your_secure_password\n```\n\n---\n\n### 🎯 Console Commands\n\n#### Dynamic Quotes\n\nDisplay inspirational quotes from GMCKS:\n\n```bash\nphp artisan dynamic:quote\n```\n\n#### Database Service Management\n\n```bash\n# View statistics\nphp artisan db-service:manage stats\n\n# View performance metrics\nphp artisan db-service:manage performance\n\n# View configuration\nphp artisan db-service:manage config\n\n# Reset connections\nphp artisan db-service:manage reset\n```\n\n#### Geo Data Management\n\n```bash\n# Sync geo data\nphp artisan sync:countries-states-json\n\n# Script management\nphp artisan geo:script install\nphp artisan geo:script run\nphp artisan geo:script status\nphp artisan geo:script uninstall\n```\n\n#### Lucide Icons\n\n```bash\n# Cache icons\nphp artisan lucide:cache check\nphp artisan lucide:cache --list=check,download,arrow-right\nphp artisan lucide:cache --force\n\n# Cache status\nphp artisan lucide:cache --status\n\n# Clear cache\nphp artisan lucide:cache --clear\n```\n\n---\n\n## 🔧 Environment Variables\n\n```env\n# Database Service\nDB_SERVICE_DEFAULT_CONNECTION=mysql\nDB_SERVICE_LOGGING_ENABLED=true\nDB_SERVICE_LOGGING_CHANNEL=stp\nDB_SERVICE_MAX_CONNECTIONS=10\nDB_SERVICE_POOL_TIMEOUT=30\nDB_SERVICE_SLOW_QUERY_THRESHOLD=2.0\n\n# SMS Configuration\nSMS_PROVIDER=myvaluefirst\nMYVALUEFIRST_URL=https://api.myvaluefirst.com/psms/servlet/psms.Sendmsg?\nMYVALUEFIRST_USERNAME=your_username\nMYVALUEFIRST_PASSWORD=your_password\nMYVALUEFIRST_FROM=SENDERID\n\n# WhatsApp Configuration\nWHATSAPP_PROVIDER=goinfinito\nGOINFINITO_API_URL=https://api.goinfinito.com/unified/v2/send\nGOINFINITO_API_TOKEN=your_token\nGOINFINITO_FROM_NUMBER=your_number\n\n# Lucide Icons\nLUCIDE_STORAGE_DISK=local\nLUCIDE_STORAGE_PATH=lucide/icons\nLUCIDE_CACHE_TTL=86400\n\n# Basic Auth\nBASIC_AUTH_USERNAME=admin\nBASIC_AUTH_PASSWORD=secret\n```\n\n---\n\n## 🧪 Testing\n\n```bash\n# Run all tests\nvendor/bin/pest\n\n# Run specific test suite\nvendor/bin/pest --filter=DBService\nvendor/bin/pest --filter=Lucide\nvendor/bin/pest --filter=Parameter\n\n# Run with coverage\nvendor/bin/pest --coverage\n```\n\n---\n\n## 📝 Migration Guide\n\n### From v1.x to v2.x\n\n#### DBService Changes\n\n**Before:**\n```php\n$dbService = new DBService($connection);\n$result = $dbService->callStoredProcedure('procedure', $params);\n```\n\n**After:**\n```php\n$dbService = EnhancedDBService::getInstance();\n$result = $dbService->callStoredProcedure('procedure', $params);\n```\n\nThe `DBDataService` trait automatically uses the new service, so no changes needed in your repository classes.\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n---\n\n## 📄 License\n\nThis package is open-source software licensed under the MIT license.\n\n---\n\n## 📚 Changelog\n\n### v3.0.0 (Latest)\n- ✨ Added Lucide Icon System with Blade components\n- ✨ Added Geo Data Service with automatic syncing\n- ✨ Added bash script alternative for geo data sync\n- ✨ Enhanced Parameter Service with multiple processing methods\n- 🔧 Improved error handling across all services\n- 🔧 Added graceful component conflict handling\n- 📝 Comprehensive documentation and examples\n\n### v2.0.0\n- 🎉 Complete rewrite of DBService with singleton pattern\n- ✨ Added connection pooling with automatic management\n- ✨ Enhanced logging with configurable channels\n- ✨ Added performance monitoring and metrics collection\n- ✨ Introduced console commands for service management\n- ✨ Added comprehensive test suite\n- 🔧 Improved error handling and retry logic\n- 📝 Added facade for easier access\n\n### v1.x\n- 🎉 Initial release with basic functionality\n\n---\n\n## 🆘 Support\n\nFor issues, questions, or contributions, please visit the [GitHub repository](https://github.com/aotr/dynamic-levels-helper).\n\n---\n\n## 👨‍💻 Author\n\n**Animesh Chakraborty**\n- GitHub: [@aotr](https://github.com/aotr)\n- Email: animesh.aotr@gmail.com\n\n---\n\nMade with ❤️ for the Laravel community\n"}}}}