PHPackages                             zymawy/arabify - 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. zymawy/arabify

ActiveLibrary[Database &amp; ORM](/categories/database)

zymawy/arabify
==============

:closed\_lock\_with\_key: A Wrapper Sluggable Traits, To Deal With Arabic Langauge

v1.3.2(7y ago)81.3k[3 PRs](https://github.com/zymawy/arabify/pulls)MITPHPPHP &gt;=5.6.4

Since Feb 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/zymawy/arabify)[ Packagist](https://packagist.org/packages/zymawy/arabify)[ Docs](https://github.com/zymawy/arabify)[ RSS](/packages/zymawy-arabify/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (19)Used By (0)

Generate slugs when saving Laravel Eloquent models
==================================================

[](#generate-slugs-when-saving-laravel-eloquent-models)

| This Is Just A Wrapper Package To Support Arabic Languages Slug

Provides a HasSlug trait that will generate a unique slug when saving your Laravel Eloquent model.

```
$model = new Article();
$model->name = 'كيف اتعلم البرمجة';
$model->save();

echo $model->slug; // ouputs "كيف-اتعلم-البرمجة"
```

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

[](#installation)

Update your project's `composer.json` file.

```
composer require zymawy/arabify
```

You may want to change the function you can do change it from the config

```
php artisan vendor:publish --provider="Zymawy\Arabify\ArabifyServiceProvider"
```

Usage
-----

[](#usage)

Your Eloquent models can use the `Zymawy\Arabfiy\HasSlug` trait and the `Zymawy\Arabfiy\SlugOptions` class.

The trait has a protected method `getSlugOptions()` that you can implement for customization.

Here's an example:

```
class YourEloquentModel extends Model
{
    use HasSlug;

    /**
     * This function is optional and only required
     * when you want to override the default behaviour
     */
    protected function getSlugOptions()
    {
        return SlugOptions::create()
            ->slugSeperator('-')
            ->generateSlugFrom('name')
            ->saveSlugTo('slug');
    }
}
```

If you want to generate your slug from a relationship.

```
class YourEloquentModel extends Model
{
    use HasSlug;

    public function getNameAndFooAttribute()
    {
        $name = $this->name;
        if ($this->foo) {
            $name .= " {$this->foo->name}";
        }

        return $name;
    }

    protected function getSlugOptions()
    {
        return SlugOptions::create()
            ->generateSlugFrom('name_and_foo');
    }
}
```

Config
------

[](#config)

You do not have to add the method in you model (the above will be used as default). It is only needed when you want to change the default behaviour.

By default it will generate a slug from the `name` and save to the `slug` column.

It will suffix a `-1` to make the slug unique. You can disable it by calling `makeSlugUnique(false)`.

It will use the `-` as a separator. You can change this by calling `slugSeperator('_')`.

You can use multiple fields as the source of the slug `generateSlugFrom(['firstname', 'lastname'])`.

You can also pass a `callable` function to `generateSlugFrom()`.

Have a look [here for the options](https://github.com/zymawy/arabify/blob/master/src/SlugOptions.php) and available config functions.

Credits
-------

[](#credits)

- **Ben-Piet O'Callaghan** - *Initial work* - [bpocallaghan](https://github.com/bpocallaghan)
- **Hamza Zymawy** - *contributor* - [zymawy](https://github.com/zymawy)

See also the list of [contributors](https://github.com/zymawy/arabify/graphs/contributors) who participated in this project.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% 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 ~0 days

Total

3

Last Release

2652d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fe0842ec0c7189b188c5ca0e77c29ae6af16e93ab96b1eb081af67cb56454fd0?d=identicon)[zymawy](/maintainers/zymawy)

---

Top Contributors

[![zymawy](https://avatars.githubusercontent.com/u/15253683?v=4)](https://github.com/zymawy "zymawy (6 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")

---

Tags

arabicarabic-sluglaravellaravel5slugsluggableslugifysluglaraveleloquentuniquearabic slugarabify

### Embed Badge

![Health badge](/badges/zymawy-arabify/health.svg)

```
[![Health](https://phpackages.com/badges/zymawy-arabify/health.svg)](https://phpackages.com/packages/zymawy-arabify)
```

###  Alternatives

[cviebrock/eloquent-sluggable

Easy creation of slugs for your Eloquent models in Laravel

4.0k13.6M253](/packages/cviebrock-eloquent-sluggable)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[highsolutions/eloquent-sequence

A Laravel package for easy creation and management sequence support for Eloquent models with elastic configuration.

121130.3k](/packages/highsolutions-eloquent-sequence)[poing/earmark

Laravel package to generate values in a unique and customizable series.

10712.9k](/packages/poing-earmark)[toponepercent/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)

PHPackages © 2026

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