The $attempts variable in generateTitleSlug() is not appended properly to the $titleSlug.
I avoid duplicate slugs by having a loop in my application code:
// Loop until a unique slug could be generated
$saved = false;
do {
try {
$saved = $user->save();
}
catch (\Illuminate\Database\QueryException $e);
}
while (!$saved);
The $attempts variable in generateTitleSlug() is not appended properly to the $titleSlug.
I avoid duplicate slugs by having a loop in my application code:
This loop never finishes.