Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Case Converter Laravel Package

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.

View on GitHub
Deep Wiki
Context7

API

List of public methods.

\Jawira\CaseConverter\Convert

String conversion

Method Description
toCamel() Return string in Camel case format
toPascal() Return string in Pascal case format
toSnake() Return string in Snake case format
toAda() Return string in Ada case format
toMacro() Return string in Macro case format
toKebab() Return string in Kebab case format
toTrain() Return string in Train case format
toCobol() Return string in Cobol case format
toLower() Return string in Lower case format
toUpper() Return string in Upper case format
toTitle() Return string in Title case format
toSentence() Return string in Sentence case format
toDot() Return string in Dot notation

Explicit case detection

Method Description
fromAuto() (default) Auto-detect naming convention
fromCamel() Split input string using uppercase characters
fromPascal() Split input string using uppercase characters
fromSnake() Split input string using _ (underscore character)
fromAda() Split input string using _ (underscore character)
fromMacro() Split input string using _ (underscore character)
fromKebab() Split input string using - (dash character)
fromTrain() Split input string using - (dash character)
fromCobol() Split input string using - (dash character)
fromLower() Split input string using (space character)
fromUpper() Split input string using (space character)
fromTitle() Split input string using (space character)
fromSentence() Split input string using (space character)
fromDot() Split input string using . (dot character)

Please note that some methods are equivalent and have the same effect:

  • fromDot()
  • fromCamel()fromPascal()
  • fromSnake()fromAda()fromMacro()
  • fromKebab()fromTrain()fromCobol()
  • fromLower()fromUpper()fromTitle()fromSentence()

All these methods exists only for sake of completeness.

Utility methods

Method Description
getSource() Returns original input string
toArray() Returns array with detected words
forceSimpleCaseMapping() Output sting uses Simple Case-Mapping even if you are using PHP 7.3 or newer

\Jawira\CaseConverter\CaseConverter

Factory method

Method Description
convert() Creates a Convert object
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4
php-http/client-implementation
phpcr/phpcr-implementation
cucumber/gherkin-monorepo
haydenpierce/class-finder
psr/simple-cache-implementation
uri-template/tests