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 Bundle Laravel Package

misatotremor/case-bundle

View on GitHub
Deep Wiki
Context7

AvroCaseBundle Build Status codecov

Convert strings or strings in arrays to different case formats.

Supports: camelCase, kebab-case, PascalCase, Title Case, and underscore_case.

This is a fork of jdewits original code.

Installation

This bundle is listed on packagist.

Download the bundle

$ composer require misatotremor/case-bundle

Enable the bundle

<?php
// config/bundles.php

return [
    // ...
    Avro\CaseBundle\AvroCaseBundle::class => ['all' => true],
    // ...
];

Configuration

Optional: Add this config

# config/packages/avro_case.yaml
avro_case:
    use_twig: false #disable the twig extension (true by default)

Usage

<?php
use Avro\CaseBundle\Util\CaseConverter;

class SomeClass
{
    private $caseConverter;

    /**
     * @param CaseConverter $caseConverter
     */
    public function __construct(CaseConverter $caseConverter)
    {
        $this->caseConverter = $caseConverter;
    }

    /**
     * @param string $str
     */
    public function foo(string $str)
    {
        $camelCaseFormat = $this->converter->toCamelCase($str);
        $kebabCaseFormat = $this->converter->toKebabCase($str);
        $pascalCaseFormat = $this->converter->toPascalCase($str);
        $titleCaseFormat = $this->converter->toTitleCase($str);
        $underscoreCaseFormat = $this->converter->toUnderscoreCase($str);
    }
}

The following filters are also available if you use Twig

    {{ var | camel }}
    {{ var | kebab }}
    {{ var | pascal }}
    {{ var | title }}
    {{ var | underscore }}
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.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata