1. Go to this page and download the library: Download areia-lab/slug-uid 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/ */
namespace App\Models;
use AreiaLab\SlugUid\Traits\HasSequence;
use AreiaLab\SlugUid\Traits\HasSlug;
use AreiaLab\SlugUid\Traits\HasUid;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
use HasSlug, HasUid, HasSequence;
public $slug_column = 'slug';
public $slug_source = 'title';
public $uid_column = 'uid';
public $uid_prefix = 'POST';
public $sequence_column = 'post_sequence';
public $sequence_prefix = 'PST';
public $sequence_padding = 4;
public $sequence_scoped = true;
public $sequence_separator = '-';
protected $fillable = ['title', 'slug', 'uid', 'post_sequence', 'description'];
}