Create Unique URL
Copy Below Code
View As A Text File
Show Text Only
Show API
Edit Code
function create_blog_unique_url($slug)
{
if(\App\Models\Back\Blog::where('post_url',$slug)->exists())
{
return create_blog_unique_url($slug.'-2');
}
else{
return $slug;
}
}