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 2w 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 52% 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

1986d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7373909?v=4)[Timofey](/maintainers/mrTimofey)[@mrTimofey](https://github.com/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

[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k29.9M42](/packages/kirschbaum-development-eloquent-power-joins)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.0M90](/packages/mongodb-laravel-mongodb)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8723.1M23](/packages/yajra-laravel-oci8)[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.2M19](/packages/bavix-laravel-wallet)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.4M2](/packages/glushkovds-phpclickhouse-laravel)[laravel-liberu/laravel-gedcom

A package that converts gedcom files to Eloquent models

782.5k1](/packages/laravel-liberu-laravel-gedcom)

PHPackages © 2026

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