Laravel unique slug

Default laravel Str::slug() function doesn’t check the uniqueness of the slug from the database. We can use a technique to make the slug unique. The following is the code to use to make an unique slug: N.B: str_slug is deprecated from Laravel version 5.8....