Weave 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

AvroCaseBundle converts strings and arrays of strings between camelCase, kebab-case, PascalCase, Title Case, and underscore_case. Includes Twig filters (camel, kebab, pascal, title, underscore) and a configurable CaseConverter service for Symfony.

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.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator