PHPackages                             mr-timofey/eloquent-sluggable - 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. [Database &amp; ORM](/categories/database)
4. /
5. mr-timofey/eloquent-sluggable

ActiveLibrary[Database &amp; ORM](/categories/database)

mr-timofey/eloquent-sluggable
=============================

Sluggable Eloquent model class

0.1.2(5y ago)22.5k1MITPHPPHP &gt;=7.1.0

Since Dec 2Pushed 5y ago1 watchersCompare

[ Source](https://github.com/mrTimofey/eloquent-sluggable)[ Packagist](https://packagist.org/packages/mr-timofey/eloquent-sluggable)[ RSS](/packages/mr-timofey-eloquent-sluggable/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (7)Used By (0)

Slugs for Eloquent models.

Features
--------

[](#features)

- `findBySlug`, `findBySlugOrFail`, `findByAny`, `findByAnyOrFail`
- Automatic slug generation on create (if not set manually) by transliterating source attribute
- Automatic unique constraint check after any slug modification on each saving (slug will be appended with -1/2/3/... until becomes unique)
- Both slug or ID route resolving (assuming ID field is integer)
- Almost anything can be customized by method overriding or class fields

Requirements
------------

[](#requirements)

- PHP 7.1
- Eloquent models

Install
-------

[](#install)

```
composer require mr-timofey/eloquent-sluggable
```

Usage
-----

[](#usage)

Just use `MrTimofey\EloquentSluggable\Sluggable` trait by any of your model classes. Define fields if needed:

```
class MyModel extends \Illuminate\Database\Eloquent\Model {
	use \MrTimofey\EloquentSluggable\Sluggable;

	/**
	 * @var string attribute name that used as a source for transliteration
	 */
	protected static $slugSource = 'name';

	/**
	 * @var string attribute name containing a slug itself
	 */
	protected static $slugField = 'slug';

	/**
	 * @var bool slug can be null
	 */
	protected static $slugNullable = false;
}
```

See trait source code if you need more customizations.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

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

Recently: every ~286 days

Total

6

Last Release

1935d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7864648122cd40602afa69f5bdf577684ae09f199ea2ab418c32005294bf89a2?d=identicon)[mrTimofey](/maintainers/mrTimofey)

---

Top Contributors

[![mrTimofey](https://avatars.githubusercontent.com/u/7373909?v=4)](https://github.com/mrTimofey "mrTimofey (11 commits)")

---

Tags

eloquent-modelslaravellaravel-5-packagelaravel-packageslugslugifiertrait

### Embed Badge

![Health badge](/badges/mr-timofey-eloquent-sluggable/health.svg)

```
[![Health](https://phpackages.com/badges/mr-timofey-eloquent-sluggable/health.svg)](https://phpackages.com/packages/mr-timofey-eloquent-sluggable)
```

###  Alternatives

[owen-it/laravel-auditing

Audit changes of your Eloquent models in Laravel

3.4k33.0M95](/packages/owen-it-laravel-auditing)[staudenmeir/eloquent-json-relations

Laravel Eloquent relationships with JSON keys

1.1k5.8M24](/packages/staudenmeir-eloquent-json-relations)[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.1M11](/packages/bavix-laravel-wallet)[dragon-code/migrate-db

Easy data transfer from one database to another

15717.4k](/packages/dragon-code-migrate-db)[gearbox-solutions/eloquent-filemaker

A package for getting FileMaker records as Eloquent models in Laravel

6454.8k2](/packages/gearbox-solutions-eloquent-filemaker)[cybercog/laravel-ownership

Laravel Ownership simplify management of Eloquent model's owner.

9126.6k3](/packages/cybercog-laravel-ownership)

PHPackages © 2026

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