Skip to content

Unique slug generator for laravel eloquent model (php, laravel, slug)

Notifications You must be signed in to change notification settings

billal4b/laravel-unique-slug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Unique Slug Generator

Unique slug generator for laravel Eloquent Model.

Installaton

composer require billal4b/laravel-unique-slug

Use from controller

Import first the UniqueSlug

use Billal\UniqueSlug\Facades\UniqueSlug;
$slug = UniqueSlug::generate(App\Models\Post::class, "First Post", "slug");
// first-post

//After crating a new post with slug First Post, then again hit
$slug = UniqueSlug::generate(App\Models\Post::class, "First Post", "slug");
// first-post-1

//After crating a new post with slug First Post, then again hit
$slug = UniqueSlug::generate(App\Models\Post::class, "First Post", "slug");
// first-post-2

Publish Configuration

php artisan vendor:publish billal4b/laravel-unique-slug

Contribution

You are open to create any pull request.

About

Unique slug generator for laravel eloquent model (php, laravel, slug)

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages