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

Slugify Bundle Laravel Package

zenstruck/slugify-bundle

Deprecated Symfony2 bundle integrating cocur/slugify. Provides a zenstruck.slugify service and optional Twig slugify filter, with configurable mode (iconv/array) and basic settings for separator and empty-value replacements.

View on GitHub
Deep Wiki
Context7

ZenstruckSlugifyBundle

DEPRECATED in favor of cocur/slugify which now includes a Symfony2 Bundle

This bundle provides integration of the Slugify library into Symfony2. A slugify service and twig filter is provided.

Installation

  1. Install with composer:

    php composer.phar require zenstruck/slugify-bundle
    
  2. Enable the bundle:

    // app/AppKernel.php
    
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Zenstruck\SlugifyBundle\ZenstruckSlugifyBundle()
        );
    }
    

Using the service

/** @var Cocur\Slugify\Slugify $slugify */
$slugify = $this->container->get('zenstruck.slugify');

Using the Twig filter

{{ 'Hello World!'|slugify }} {# hello-world #}

{# custom space separator #}
{{ 'Hello World!'|slugify('_') }} {# hello_world #}

{# custom space separator and custom replacement for emptyValue #}
{{ '####'|slugify('_', 'non') }} {# non #}

Full Default Configuration

zenstruck_slugify:
    twig: true #enable twig filter
    mode: array #iconv or array mode
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.
croct/coding-standard
croct/plug-php
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
imbo/imbo-coding-standard
visualbuilder/filament-lottie
servicioslineaonce/starter-kit
atomcoder/laravel-reorderable
irajul/filament-shadcn-theme
agtp/agtp-php
agtp/mod-php
centraldesktop/protobuf-php
trappistes/laravel-custom-fields
splash/sonata-admin
splash/metadata