Downloads
Stars
Version
This is simple unique slug generator package for Laravel. It is easy to use your any Laravel project.
You can install the package via composer:
composer require amdad121/unique-slug-laravel
namespace App\Models;
use AmdadulHaq\UniqueSlug\HasSlug;
// ...
class User extends Authenticatable
{
use HasSlug;
// Optionally you can configure
public function getSlugSourceAttribute(): string
{
return 'name'; // Default attribute to generate slug from
}
public function getSlugAttribute(): string
{
return 'slug'; // Default attribute to store the slug
}
public function getSlugSeparator(): string
{
return '-'; // Default separator for the slug
}
}
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.