Slugit is a laravel slug generator for eloquent models with support for all languages.

0.1.4 2017-03-11 10:46 UTC

This package is not auto-updated.

Last update: 2021-01-22 23:37:51 UTC


Dependency Status Latest Stable Version License


Slugit is a laravel slug generator for eloquent models with support for almost all languages.


  • Generating slugs automatically by simply configuring eloquent models
  • Multi language support like English, Arabic, Hindi … etc.
  • Configuring the separator character
  • Generating unique or none unique slugs


You can install the package via composer by simply running the following command

$ composer require harran/slugit

Then add the service provider to this file config/app.php

'providers' => [
    // ...

Final step, publish the config file using the following command

php artisan vendor:publish

##Usage To start using the package you need to do one simple step, you need to define in your models which field is your slug field and which field is the source of this slug field, in the case of below example our slug field is slug and the source field if title.


namespace App;

use Illuminate\Database\Eloquent\Model;
use Harran\Slugit\SlugService;

class Post extends Model
	use SlugService;

	 * Setting which field is the slug and which field is the source for generating the slug
	 * @return array
    public function slugSettings(){
    	return [
    		'slug' => 'title'

Then every time you create a new post like below, the slug will be generated automatically for you.

$post = new Post([
    'title' => 'some post is here',