islomiddin-dev/unique-slug-generator

Unique slug generator for Laravel framework. supports soft delete and hard delete

v1.0.4 2023-04-13 05:12 UTC

This package is auto-updated.

Last update: 2024-11-13 08:44:47 UTC


README

Total Downloads Latest Stable Version License

Recommended

  • PHP 8.0 +
  • Laravel 9.0 +

Installation

Composer

composer require islomiddin-dev/unique-slug-generator

Please add this provider to the list of providers in your config/app.php file.

IslomiddinDev\Providers\HelperServiceProvider::class,

Example

slug(modelClass: Post::class, attribute: 'title', name: $request->title);

Output

//name: Unique Slug Generator
//output: unique-slug-generator

//name: Unique Slug Generator
//output: unique-slug-generator-1
  • modelClass: Model class name
  • attribute: Model attribute name
  • name: Model attribute value