PHP code example of tarek111 / laravel-unique-slug
1. Go to this page and download the library: Download tarek111/laravel-unique-slug library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tarek111 / laravel-unique-slug example snippets
use Tarek\LaravelUniqueSlug\Facades\UniqueSlug;
UniqueSlug::generate(User::class,'john doe','name');
//john-doe
//After creating a new user with name john doe then again hit
UniqueSlug::generate(User::class,'john doe','name');
//john-doe-1
sh
php artisan vendor:publish "tarek111/laravel-unique-slug"