PHPackages                             josezenem/laravel-slugidable - 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. josezenem/laravel-slugidable

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

josezenem/laravel-slugidable
============================

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

1.3.0(1y ago)1159.5k↑43.8%[4 PRs](https://github.com/josezenem/laravel-slugidable/pulls)MITPHPPHP ^8.0CI passing

Since Feb 9Pushed 2mo ago1 watchersCompare

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

READMEChangelog (5)Dependencies (10)Versions (10)Used By (0)

Slugidable Generate slugs based on title and ID
===============================================

[](#slugidable-generate-slugs-based-on-title-and-id)

[![Latest Stable Version](https://camo.githubusercontent.com/36da739f8124f5cd45526ac80e220a8d1af4eb907f96bc3638e3a33061d24062/687474703a2f2f706f7365722e707567782e6f72672f6a6f73657a656e656d2f6c61726176656c2d736c7567696461626c652f76)](https://packagist.org/packages/josezenem/laravel-slugidable)[![Tests](https://github.com/josezenem/laravel-slugidable/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/josezenem/laravel-slugidable/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/399e7e496db562eab8379b4af6f7b5b3b0cf87a4a8bedb20b0556424a363e81d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f73657a656e656d2f6c61726176656c2d736c7567696461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/josezenem/laravel-slugidable)

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

```
$model = new Blog();
$model->title = 'Dwight jumped over the fence';
$model->save();

echo $model->slug; // output: dwight-jumped-over-the-fence-012422
```

All settings are fully configurable for each model.

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

[](#installation)

You can install the package via composer:

```
composer require josezenem/laravel-slugidable
```

Usage
-----

[](#usage)

Simply `Josezenem\Slugidable\Slugidable` trait to your model.

```
// App\Models\Blog
