src/Sluggable.php
public function scopeFindSimilarSlugs(Builder $query, string $attribute, array $config, string $slug): Builder
    {
        $separator = $config['separator'];

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

        return $query->where(function(Builder $q) use ($attribute, $slug, $separator) {
            $q->where($attribute, '=', $slug)
                ->orWhere($attribute, 'LIKE', $slug . $separator . '%');
        });
    }
public function scopeFindSimilarSlugs ( Builder $ query , string $ attribute , array $ config , string $ slug ) : Builder { $ separator = $ config [ 'separator' ] ; return $ query -> where ( function ( Builder $ q ) use ( $ attribute , $ slug , $ separator ) { $ q -> 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
Query scope for finding similar slugs used to determine uniqueness .