Skip to content

Commit

Permalink
If empty string - set seperator as value
Browse files Browse the repository at this point in the history
  • Loading branch information
bpocallaghan committed Oct 31, 2019
1 parent 4f6ab58 commit 1d1b25b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/HasSlug.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,15 @@ protected function createSlug()
*/
protected function generateNonUniqueSlug()
{
$slug = $this->getSlugSourceString();
$source = $this->getSlugSourceString();

return Str::slug($slug, $this->slugOptions->slugSeparator);
$slug = Str::slug($source, $this->slugOptions->slugSeparator);

if ($slug === '' && $source !== '') {
$slug = $this->slugOptions->slugSeparator;
}

return $slug;
}

/**
Expand Down

0 comments on commit 1d1b25b

Please sign in to comment.