PHPackages                             daaner/easy-slug - 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. daaner/easy-slug

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

daaner/easy-slug
================

Easy creation of slugs for Laravel 5.4+

1.0.5(6y ago)0438MITPHPPHP &gt;=5.4

Since May 27Pushed 4y agoCompare

[ Source](https://github.com/daaner/easy-slug)[ Packagist](https://packagist.org/packages/daaner/easy-slug)[ RSS](/packages/daaner-easy-slug/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (4)Used By (0)

EasySlug (easy creation of slugs for Laravel 5+)
================================================

[](#easyslug-easy-creation-of-slugs-for-laravel-5)

[![Packagist License](https://camo.githubusercontent.com/7f4ab51b47ace96fe860d76056ec903d3a897a730c6a515e6d222a61f7d3fbd7/68747470733a2f2f706f7365722e707567782e6f72672f6461616e65722f656173792d736c75672f6c6963656e73652e706e67)](http://choosealicense.com/licenses/mit/)[![Latest Stable Version](https://camo.githubusercontent.com/193a50806226ea352081b535b8edfb09261751ae518cef202b702a9763257122/68747470733a2f2f706f7365722e707567782e6f72672f6461616e65722f656173792d736c75672f762f737461626c65)](https://packagist.org/packages/daaner/easy-slug)[![Total Downloads](https://camo.githubusercontent.com/f4c24009030cc8c6eee700aa43bfa9228f1a967fbcdeb3e747be6856270f4337/68747470733a2f2f706f7365722e707567782e6f72672f6461616e65722f656173792d736c75672f646f776e6c6f616473)](https://packagist.org/packages/daaner/easy-slug)

Fix
---

[](#fix)

- fix softDeleted tray

About
-----

[](#about)

\[ru\] Простое создание уникального слага для Ларавел 5+

\[en\] Simple creation of a unique slug for Laravel 5+

Установка
---------

[](#установка)

`composer require daaner/easy-slug`

\[ru\]

- В шапке модели `use EasySlug\EasySlug;`
- В теле модели подключаем трейт `use EasySlug;`

\[en\]

- In header model `use EasySlug\EasySlug;`
- In the body of the model use trait `use EasySlug;`

```
...
use EasySlug\EasySlug;

class BaseModel extends Model
{

  use EasySlug;
...

```

Использование
-------------

[](#использование)

\[ru\]

- Добавляем мутатор в нужную модель (или базовую модель)
- Первый параметр `$value` - наше значение
- Второй параметр `slug` - поле, в котором хранится наш слаг
- Третий параметр `custom_field` - поле из которого будет формироваться слаг
- Обрезает длину слага до 100 символов

ЗЫ: Если Вы хотите формировать слаг из полей `title` или `name` - третий параметр можно не указывать (если находит `title` формирует сперва из него, если нет - ищет `name`). Если третий параметр не указан или не найден - формируется слаг `'slug_'. date("Y-m-d-H-i-s")`, проверяется на уникальность и, если есть совпадения, дописывает первое уникальное число через дефис.

\[en\]

- Add a mutator to the desired model (or base model)
- The first parameter `$value` is our value
- The second parameter `slug` is the field in which our slug is stored
- The third parameter `custom_field` is the field from which the slug will be formed
- Cuts the length of the slag to 100 characters

PS: If you want to form a slug from the `title` or` name` fields - the third parameter can be null (if it finds `title` forms first of it, if not, it searches for` name`). If the third parameter is not specified or not found, the slug formed `'slug_'. date("Y-m-d-H-i-s")`, is checked for uniqueness and, if there are matches, appends the first unique number with a hyphen.

```
public function setSlugAttribute($value) {

  $this->EasySlugCheck($value, 'slug', 'custom_field');

}

```

Контакты
--------

[](#контакты)

 по всем вопросам

License
-------

[](#license)

EasySlug is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

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 ~26 days

Total

3

Last Release

2490d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab7685d68b0a7a826663193b526e128552ed0993708eda185d25118745641e84?d=identicon)[Daaner](/maintainers/Daaner)

---

Top Contributors

[![daaner](https://avatars.githubusercontent.com/u/9641698?v=4)](https://github.com/daaner "daaner (14 commits)")

---

Tags

sluglaravelsluggableLaravel-Slug

### Embed Badge

![Health badge](/badges/daaner-easy-slug/health.svg)

```
[![Health](https://phpackages.com/badges/daaner-easy-slug/health.svg)](https://phpackages.com/packages/daaner-easy-slug)
```

###  Alternatives

[balping/laravel-hashslug

Package providing a trait to use Hashids on a model

25185.2k2](/packages/balping-laravel-hashslug)[josezenem/laravel-slugidable

A package for Laravel that creates slugs for Eloquent models based on title and ID

1159.5k](/packages/josezenem-laravel-slugidable)

PHPackages © 2026

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