PHPackages                             developvi/laravel-slug-i18n - 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. [Localization &amp; i18n](/categories/localization)
4. /
5. developvi/laravel-slug-i18n

ActiveLibrary[Localization &amp; i18n](/categories/localization)

developvi/laravel-slug-i18n
===========================

A Laravel package to generate multilingual slugs (UTF-8) with optional transliteration skipping for specific locales.

1.0.0(11mo ago)04MITPHPPHP ^8.0

Since Jul 22Pushed 11mo agoCompare

[ Source](https://github.com/developvi/laravel-slug-i18n)[ Packagist](https://packagist.org/packages/developvi/laravel-slug-i18n)[ RSS](/packages/developvi-laravel-slug-i18n/feed)WikiDiscussions main Synced today

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

Laravel Slug I18n
=================

[](#laravel-slug-i18n)

A professional Laravel package to generate multilingual UTF-8 slugs with smart, configurable skipping of transliteration for specific locales (like Arabic, Farsi, Urdu, etc.), while keeping Laravel’s original Str::slug() behavior intact.

---

🚀 Features
----------

[](#-features)

- Generate clean, SEO-friendly slugs for any language
- Skip transliteration automatically for configurable locales (e.g., ar, fa, ur)
- Fully compatible with Laravel’s Str helper
- Supports Laravel 9, 10, 11, 12
- Zero config (but highly configurable if needed)
- Auto-discovered (no need to manually register service provider)
- Publishable config file for easy customization
- Supports custom dictionary replacements and force skip

---

📦 Installation
--------------

[](#-installation)

```
composer require developvi/laravel-slug-i18n
```

---

⚙️ Configuration
----------------

[](#️-configuration)

You can publish the config file with:

```
php artisan vendor:publish --tag=slug-i18n-config
```

### .env Options

[](#env-options)

- **SLUG\_I18N\_ENABLED**: Enable or disable the package (default: true)
- **SLUG\_I18N\_SKIP\_LOCALES**: Comma-separated list of locales to skip transliteration for (e.g., `ar,fa,ur`)

Example:

```
SLUG_I18N_ENABLED=true
SLUG_I18N_SKIP_LOCALES=ar,fa,ur

```

### config/slug-i18n.php

[](#configslug-i18nphp)

You can also edit the config file directly for advanced control:

```
return [
    'enabled' => env('SLUG_I18N_ENABLED', true),
    'skip_locales' => [
        ...array_filter(
            explode(',', (string) env('SLUG_I18N_SKIP_LOCALES', ''))
        ),
    ],
];
```

---

🧑‍💻 Usage
---------

[](#‍-usage)

### Basic Usage

[](#basic-usage)

Use the new macro `Str::slugI18n` for full control:

```
use Illuminate\Support\Str;

// Will skip transliteration for Arabic if configured
$slug = Str::slugI18n('مثال على نص عربي', '-', 'ar'); // Output: مثال-على-نص-عربي

// Will transliterate for English
$slug = Str::slugI18n('Example English Text', '-', 'en'); // Output: example-english-text
```

### Macro Signature

[](#macro-signature)

```
Str::slugI18n(
    string $title,
    string $separator = '-',
    string $language = 'en',
    array $dictionary = ['@' => 'at'],
    bool $forceSkip = false
): string
```

- **$title**: The string to slugify
- **$separator**: Word separator (default: '-')
- **$language**: Language/locale code (e.g., 'ar', 'en', ...)
- **$dictionary**: Custom replacements (e.g., \['@' =&gt; 'at'\])
- **$forceSkip**: If true, always skip transliteration regardless of config

### Advanced Usage

[](#advanced-usage)

```
// Custom dictionary and force skip
$slug = Str::slugI18n('Laravel@10 ❤️', '-', 'en', ['@' => 'at', '❤️' => 'love'], true); // laravel-at-10-love

// Force skip transliteration for any language
$slug = Str::slugI18n('مثال على نص عربي', '-', 'en', [], true); // مثال-على-نص-عربي
```

---

🧪 Testing
---------

[](#-testing)

To run the package tests:

```
composer install
./vendor/bin/phpunit
```

---

📝 License
---------

[](#-license)

MIT

---

👤 Author
--------

[](#-author)

**Eslam El Sherif**

---

💡 Example in Laravel Route
--------------------------

[](#-example-in-laravel-route)

```
use Illuminate\Support\Str;

Route::get('/slug', function () {
    $slug = Str::slugI18n('مرحبا بك', forceSkip: true);
    return $slug; // Output: مرحبا-بك
});
```

---

🤝 Contributing
--------------

[](#-contributing)

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance51

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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

Unknown

Total

1

Last Release

348d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/21009117?v=4)[eslam el sherif](/maintainers/eslam-dev)[@eslam-dev](https://github.com/eslam-dev)

---

Top Contributors

[![eslam-dev](https://avatars.githubusercontent.com/u/21009117?v=4)](https://github.com/eslam-dev "eslam-dev (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[illuminate/translation

The Illuminate Translation package.

6938.0M571](/packages/illuminate-translation)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React/Svelte) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

4925.3k](/packages/erag-laravel-lang-sync-inertia)

PHPackages © 2026

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