jawira/case-converter
Convert strings between common case styles (camelCase, snake_case, kebab-case, PascalCase, etc.) with a simple PHP API. Handy for slugs, variable naming, and text normalization, supporting robust Unicode-aware conversions and formatting options.
Install the package via Composer:
composer require jawira/case-converter
Start by converting simple strings using the CaseConverter facade or class. The most common first use case is normalizing user input or API payloads into snake_case or camelCase for consistent internal handling:
use Jawira\CaseConverter\CaseConverter;
$converter = new CaseConverter();
$camel = $converter->toCamelCase('user_first_name'); // 'userFirstName'
$snake = $converter->toSnakeCase('UserName'); // 'user_name'
$kebab = $converter->toKebabCase('fileNameWithNumbers'); // 'file-name-with-numbers'
Check the README (even without a public repo link, the package docs are typically embedded or linked in Packagist).
toSnakeCase()) before processing to unify data structures across services.toCamelCase() or toPascalCase() to match PHP property naming standards.toSnakeCase() for database columns, toKebabCase() for URL slugs).toKebabCase() if downstream services require it.CaseConverter in test fixtures to generate predictable variable names or identifiers across multiple conventions.toSnakeCase('HTTPRequest') → 'http_request'), but Cobol case and Ada case may behave unexpectedly with irregular inputs—always validate edge cases like 'APIV2'.toLower() or toUpper() to pre-normalize input if needed.'uuid' → 'UUID' after conversion).~4.0).How can I help you explore Laravel packages today?