PHPackages                             teariot/beautyslug - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. teariot/beautyslug

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

teariot/beautyslug
==================

Lightweight PHP library for generating random readable slugs.

1.0.0(1y ago)12.7k↓33.3%MITPHPPHP ^8.2

Since Apr 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/TeaRiot/BeautySlug)[ Packagist](https://packagist.org/packages/teariot/beautyslug)[ RSS](/packages/teariot-beautyslug/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

BeautySlug
==========

[](#beautyslug)

[![PHP Version](https://camo.githubusercontent.com/d4b5fa4adf514144779a7864904c5e15236c0e798635240c7f6ce9a455657b80/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e302532422d626c75652e737667)](https://www.php.net/)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

**BeautySlug** is a lightweight, flexible PHP library for generating beautiful, readable slugs.

---

🚀 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require teariot/beautyslug
```

---

⚡ Quick Usage
-------------

[](#-quick-usage)

```
use BeautySlug\BeautySlug;
use BeautySlug\SlugWords;

// Basic random slug
echo BeautySlug::slug();
// Example: wonderful-tree

// Slug with a color and an animal
echo BeautySlug::slug([
    SlugWords::color(1),
    SlugWords::animal(1),
]);
// Example: blue-lion

// Slug with digits appended
echo BeautySlug::slug([
    SlugWords::adjective(1),
    SlugWords::noun(1),
], [
    'appendDigits' => true,
    'digitsCount' => 5,
]);
// Example: fancy-robot-48291
```

---

⚙️ Options
----------

[](#️-options)

OptionTypeDescriptionDefault`separator``string`Separator between words`-``appendDigits``bool`Append random digits at the end`false``digitsCount``int`Number of digits to append if enabled`4`You can override options by passing an array as the second parameter to `slug()`.

---

🧩 Available Word Categories
---------------------------

[](#-available-word-categories)

BeautySlug uses predefined word lists:

- `adjective`
- `noun`
- `color`
- `season`
- `emoji`
- `verb`
- `animal`
- `cosmos`

You can directly access random words:

```
SlugWords::adjective(2); // Get 2 random adjectives
SlugWords::noun(1);      // Get 1 random noun
SlugWords::color(1);     // Get 1 random color
```

---

📂 Example Script
----------------

[](#-example-script)

See the [`examples/usage.php`](examples/usage.php) file for more examples.

To run:

```
php examples/usage.php
```

---

📄 License
---------

[](#-license)

Released under the [MIT License](LICENSE).

---

> Built with ❤️ by [Teariot](https://github.com/teariot)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance48

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

385d ago

### Community

Maintainers

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

---

Top Contributors

[![TeaRiot](https://avatars.githubusercontent.com/u/148728335?v=4)](https://github.com/TeaRiot "TeaRiot (1 commits)")

---

Tags

cms-friendly-slugcomposerfriendly-urllaravel-slugphpphp-slugrandom-slugseoseo-friendly-slugseo-urlslug-generatorslugifyunique-slugurl-identifierurl-slugphpslugslugifyrandom stringslug-generatortext generatorUnique Slugstring generatorphp Slugrandom slug

### Embed Badge

![Health badge](/badges/teariot-beautyslug/health.svg)

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

###  Alternatives

[ausi/slug-generator

Slug Generator

8002.2M22](/packages/ausi-slug-generator)[jbroadway/urlify

A fast PHP slug generator and transliteration library that converts non-ascii characters for use in URLs.

6737.4M62](/packages/jbroadway-urlify)[keyvanakbary/slugifier

A full-featured, simple, clean and pure functional implementation for creating slugs

68187.9k4](/packages/keyvanakbary-slugifier)

PHPackages © 2026

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