PHPackages                             yic/sluggable-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. yic/sluggable-bundle

ActiveSymfony-bundle

yic/sluggable-bundle
====================

A Symfony bundle for slug-based entity routing.

v1.0.0(1y ago)122MITPHPPHP ^8.1

Since May 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/yaovicoder/sluggable-bundle)[ Packagist](https://packagist.org/packages/yic/sluggable-bundle)[ RSS](/packages/yic-sluggable-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (11)Versions (2)Used By (0)

Sluggable Bundle
================

[](#sluggable-bundle)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

A Symfony bundle that provides automatic slug generation and slug-based routing (ParamConverter resolution by ID or slug) for Doctrine entities implementing `SluggableInterface`.

✨Features
---------

[](#features)

- Generic `SluggableInterface` for entities
- ParamConverter that works with both IDs and slugs
- Automatic service registration
- Works with Gedmo Sluggable behavior

🧩Installation
-------------

[](#installation)

1. Install the bundle via Composer:

```
composer require yic/sluggable-bundle
```

⚙️Basic Usage
-------------

[](#️basic-usage)

### Implement `Sluggable`

[](#implement-sluggable)

```
use YIC\SluggableBundle\Entity\Interface\SluggableInterface;
use Gedmo\Mapping\Annotation as Gedmo;

class Product implements SluggableInterface
{
    #[Gedmo\Slug(fields: ['title'])]
    private ?string $slug = null;

    public function getSlug(): ?string {
        return $this->slug;
    }

    public function setSlug(?string $slug): self {
        $this->slug = $slug;
        return $this;
    }
}
```

### Use in controllers

[](#use-in-controllers)

```
#[Route('/products/{id}', name: 'product_show')]
public function show(Product $product): Response
{
    // Works with:
    // /products/1         (ID)
    // /products/some-name (slug)
}
```

Configuration
-------------

[](#configuration)

Default config (`config/packages/yic_sluggable.yaml`):

```
yic_sluggable:
    # Enable slug fallback when ID not found
    slug_fallback: true

```

Development Setup
-----------------

[](#development-setup)

```
# Clone
git clone https://github.com/yaovicoder/sluggable-bundle.git
cd sluggable-bundle

# Install deps
composer install

# Run tests
composer test
```

📦 Dependencies
--------------

[](#-dependencies)

### Core Requirements

[](#core-requirements)

```
| Package                          | Version   | Purpose                   |
|----------------------------------|-----------|---------------------------|
| php                              | ^8.1      | PHP runtime               |
| symfony/framework-bundle         | ^6.4      | Symfony core              |
| doctrine/orm                     | ^2.15     | Database abstraction      |
| gedmo/doctrine-extensions        | ^3.11     | Slug behavior             |
| sensio/framework-extra-bundle    | ^6.0      | ParamConverter            |
```

### Development Dependencies

[](#development-dependencies)

```
| Package                          | Version   | Purpose                   |
|----------------------------------|-----------|---------------------------|
| phpunit/phpunit                  | ^10.0     | Testing                   |
| symfony/phpunit-bridge           | ^6.4      | Symfony test integration  |
| vimeo/psalm                      | ^5.22     | Static analysis           |

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance48

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

380d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6c7ae1b5ebb8742a52176a7647f12f58680fa236427fee6df208be3fd02b00d3?d=identicon)[yaovicoder](/maintainers/yaovicoder)

---

Top Contributors

[![yaovicoder](https://avatars.githubusercontent.com/u/2089260?v=4)](https://github.com/yaovicoder "yaovicoder (8 commits)")

---

Tags

slugsymfonybundlerouting

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yic-sluggable-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/yic-sluggable-bundle/health.svg)](https://phpackages.com/packages/yic-sluggable-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[pentatrion/vite-bundle

Vite integration for your Symfony app

2725.3M13](/packages/pentatrion-vite-bundle)[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

578630.7k1](/packages/scheb-2fa)[sensiolabs/gotenberg-bundle

A Symfony bundle that provides seamless integration with Gotenberg for generating PDFs and screenshots from various sources (HTML, Markdown, Office documents, URLs) with a clean, builder-based API.

210210.4k2](/packages/sensiolabs-gotenberg-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
