src/Database/Traits/HasPermalink.php
public function scopeFindSimilarSlugs($query, $attribute, array $config, $slug)
    {
        $separator = $config['separator'];

        return $query->where($attribute, $slug)
                     ->orWhere($attribute, 'LIKE', $slug.$separator.'%');
    }
public function scopeFindSimilarSlugs($query, $attribute, array $config, $slug)
    {
        $separator = $config['separator'];

        return $query->where($attribute, $slug)
                     ->orWhere($attribute, 'LIKE', $slug.$separator.'%');
    }
Query scope for finding "similar" slugs, used to determine uniqueness.

@param \Illuminate\Database\Eloquent\Builder $query
@param string $attribute
@param array $config
@param string $slug

@return \Illuminate\Database\Eloquent\Builder