PHPackages                             ryangjchandler/laravel-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. ryangjchandler/laravel-slug

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

ryangjchandler/laravel-slug
===========================

Simple slugs for your Laravel models.

v1.1.1(3y ago)25191MITPHPPHP ^8.1

Since Apr 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ryangjchandler/laravel-slug)[ Packagist](https://packagist.org/packages/ryangjchandler/laravel-slug)[ Docs](https://github.com/ryangjchandler/laravel-slug)[ RSS](/packages/ryangjchandler-laravel-slug/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (12)Versions (7)Used By (0)

Simple slugs for your Laravel models.
=====================================

[](#simple-slugs-for-your-laravel-models)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b92f6871b9acaecd05acf8ce7bf71a66c0663a632d1c5e7355fc05bdf4a92b3d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7279616e676a6368616e646c65722f6c61726176656c2d736c75672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ryangjchandler/laravel-slug)[![GitHub Tests Action Status](https://camo.githubusercontent.com/c858d7fa6a952554ccb9c1239c8f832bdb63099f5140ea041e0bce61481d88ef/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7279616e676a6368616e646c65722f6c61726176656c2d736c75672f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/ryangjchandler/laravel-slug/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/ff0e330aff3c55512010f66ec7b62338f02512ac2f6f966bc9763657cebde7d7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f7279616e676a6368616e646c65722f6c61726176656c2d736c75672f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/ryangjchandler/laravel-slug/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/13e1bff7956c8e59614b91bf9237ae60842f215c49ef4735ff7fa8939b56d019/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7279616e676a6368616e646c65722f6c61726176656c2d736c75672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ryangjchandler/laravel-slug)

This packages provides an opinionated, attribute-driven trait for automatically generating slugs when creating Laravel models.

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require ryangjchandler/laravel-slug
```

Usage
-----

[](#usage)

Use the `RyanChandler\Slug\Concerns\HasSlug` trait on your model class.

```
use RyanChandler\Slug\Concerns\HasSlug;

class Post extends Model
{
    use HasSlug;
}
```

By default, this package will generate a slug using a `title` column on your model and store the value in a `slug` column.

This can be changed using the `RyanChandler\Slug\Attribute\Slug` attribute.

```
use RyanChandler\Slug\Concerns\HasSlug;
use RyanChandler\Slug\Attribute\Slug;

#[Slug(source: 'name', column: 'my_slug')]
class Post extends Model
{
    use HasSlug;
}
```

The `source` argument should contain the name of the column you'd like to generate a slug from. The `column` argument should contain the name of the column you'd like to store the generated slug in.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Ryan Chandler](https://github.com/ryangjchandler)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 52.9% 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 ~95 days

Total

3

Last Release

1306d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/568d485d441c691b0358b9091254a6a671fef8f76b73f28af1180ad568d142b2?d=identicon)[ryangjchandler](/maintainers/ryangjchandler)

---

Top Contributors

[![ryangjchandler](https://avatars.githubusercontent.com/u/41837763?v=4)](https://github.com/ryangjchandler "ryangjchandler (18 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (8 commits)")

---

Tags

laravelryangjchandlerLaravel-Slug

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/ryangjchandler-laravel-slug/health.svg)

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

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)

PHPackages © 2026

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