PHPackages                             sarowar/laravel-unique-slug-generator - 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. sarowar/laravel-unique-slug-generator

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

sarowar/laravel-unique-slug-generator
=====================================

A unique slug generator for laravel application

v1.1.1(1y ago)04MITPHPPHP ^7.4 || ^8.0

Since Oct 15Pushed 1y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (4)Used By (0)

Laravel Slug Generator
======================

[](#laravel-slug-generator)

Laravel Slug Generator is a simple and user-friendly package that helps automatically create unique slugs in Laravel projects. This package generates slugs from titles, which can then be used in URLs and for SEO purposes. It offers the ability to limit the length of the slugs, use custom separators, and automatically append numbers to avoid conflicts with existing slugs in the database. This package streamlines the slug generation process, making it easy and efficient for your Laravel application.

Version
-------

[](#version)

**Current Version:** 1.1.0

Features
--------

[](#features)

- Automatically generates slugs from titles.
- Supports custom separators.
- Allows limiting the length of slugs.
- Automatically appends numbers to avoid conflicts with existing slugs in the database.

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

[](#installation)

You can install the package via Composer:

```
composer require sarowar/laravel-unique-slug-generator
```

Publishing Configuration
------------------------

[](#publishing-configuration)

To publish the configuration file, run the following command:

```
php artisan vendor:publish --provider="Sarowar\LaravelSlugGenerator\LaravelSlugServiceProvider"
```

- This will create a configuration file named `sarowar-slug-generator.php` in the config directory of your Laravel application. You can customize the settings in this file according to your requirements.

Usage
-----

[](#usage)

Here’s a basic example of how to use the slug generator:

```
use Sarowar\LaravelSlugGenerator\LaravelSlug;
```

```
// Create an instance of the slug generator
$slugGenerator = new LaravelSlug();
```

```
// Generate a unique slug
$slug = $slugGenerator->generate($model, $title, $field);
```

### In this example:

[](#in-this-example)

- `$model:` The model class from which the slug will be generated.
- `$title:` The value that will be used to generate the slug.
- `$field:` The field name in the model that will be used to create the slug.

Configuration
-------------

[](#configuration)

You can customize the slug generation by modifying the `config/sarowar-slug-generator.php` file. Options include:

- `separator:` The character to use between words in the slug (default is `-`).
- `max_length:` The maximum length of the generated slug (default is `100`).

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

[](#contributing)

- Contributions are welcome! Please open an issue or submit a pull request.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

Total

3

Last Release

572d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ebb9bd3ff559402002506c4ab267dc898dc18f4acdf907d9b6395902eee5770?d=identicon)[smsarowar](/maintainers/smsarowar)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/sarowar-laravel-unique-slug-generator/health.svg)

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

PHPackages © 2026

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