PHPackages                             breda/slugger - 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. breda/slugger

ActiveLibrary

breda/slugger
=============

This library provides a utility class to make slugs out of strings.

1.0.1(7y ago)011PHPPHP ^7.2

Since Mar 27Pushed 6y ago1 watchersCompare

[ Source](https://github.com/breda/slugger)[ Packagist](https://packagist.org/packages/breda/slugger)[ RSS](/packages/breda-slugger/feed)WikiDiscussions master Synced 3d ago

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

Slugger
=======

[](#slugger)

Slugger is a simple PHP utility class to make slugs out of strings, that can handle special Arabic/French characters.

[![Build Status](https://camo.githubusercontent.com/c578fb96214b56725ce9463f502fac393be6fc0d28ecd032c99cb699133f9b19/68747470733a2f2f7472617669732d63692e6f72672f62726564612f736c75676765722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/breda/slugger)

---

While working at [Kreo](https://www.kreo-agency.com/),

I needed a library that can generate slugs from strings with some special characters, like French accented characters as well as [Arabic Shadda](https://en.wikipedia.org/wiki/Shadda) and special Arabic characters (like the Arabic comma `،`).

This might not be a complete slugger but this what worked for me at the time, so I thought I'd share it. Any suggestions and feedback are most welcome :-)

Example usage
-------------

[](#example-usage)

```
use BReda\Slugger\Slugger;

// Normal call
$slugger = new Slugger('-', [
    // Presets here, remove/add what's needed,
    // but at least the basic preset should be present.
    new \BReda\Slugger\Presets\BasicPreset,
    new \BReda\Slugger\Presets\ArabicPreset,
]);

// Load a new preset
$slugger->loadPreset(new \BReda\Slugger\Presets\FrenchPreset);

// Make the slug
$slugged = $slugger->make("This should be slugged");

// Statically
// When using staticMake, all available presets will be loaded.
$slugged = Slugger::staticMake("This should be slugged too", "-");
```

I wrote this utility class to be compatible with [Eloquent Sluggable](https://github.com/cviebrock/eloquent-sluggable)which I was using at the time, with Laravel PHP Framework. But it can be used anywhere of course.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Every ~0 days

Total

2

Last Release

2606d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5137672a7db08895069bb84567bc080c03673ffd95522bbf713bd1cba64cec12?d=identicon)[breda](/maintainers/breda)

---

Top Contributors

[![breda](https://avatars.githubusercontent.com/u/6480910?v=4)](https://github.com/breda "breda (13 commits)")

---

Tags

arabicfrenchphpslugger

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/breda-slugger/health.svg)

```
[![Health](https://phpackages.com/badges/breda-slugger/health.svg)](https://phpackages.com/packages/breda-slugger)
```

PHPackages © 2026

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