src/Sluggable/SluggableTrait.php
protected function getAllSlugsForModuleFromCmsTable($likeSlug = null, $limitToLanguage = true)
    {
        /** @var CmsModel|SluggableTrait $this */

        $config         = $this->getSluggableConfig();
        $includeTrashed = $config['include_trashed'];
        $separator      = $config['separator'];


        $existing = DB::table(static::$slugsTable)
            ->select([ 'id', static::$slugsColumn . ' as slug' ])
            ->where(static::$slugsModuleKey, $this->getModuleNumber())
            ->where(function ($query) use ($likeSlug, $separator) {
                $query->where(static::$slugsColumn, $likeSlug);
                $query->orWhere(static::$slugsColumn, 'LIKE', $likeSlug . $separator . '%');
            });


        if ( ! $includeTrashed && static::$slugsActiveColumn) {
            $existing->where(static::$slugsActiveColumn, true);
        }

        if ($limitToLanguage) {

            $existing->where(static::$slugsLanguageKey, $this->storeSlugForLanguageId());
        }

        $list = $existing->lists(static::$slugsColumn, static::$slugsEntryKey);

        // Laravel 5.0/5.1 check
        return $list instanceof Collection ? $list->all() : $list;
    }
protected function getAllSlugsForModuleFromCmsTable($likeSlug = null, $limitToLanguage = true)
    {
        /** @var CmsModel|SluggableTrait $this */

        $config         = $this->getSluggableConfig();
        $includeTrashed = $config['include_trashed'];
        $separator      = $config['separator'];


        $existing = DB::table(static::$slugsTable)
            ->select([ 'id', static::$slugsColumn . ' as slug' ])
            ->where(static::$slugsModuleKey, $this->getModuleNumber())
            ->where(function ($query) use ($likeSlug, $separator) {
                $query->where(static::$slugsColumn, $likeSlug);
                $query->orWhere(static::$slugsColumn, 'LIKE', $likeSlug . $separator . '%');
            });


        if ( ! $includeTrashed && static::$slugsActiveColumn) {
            $existing->where(static::$slugsActiveColumn, true);
        }

        if ($limitToLanguage) {

            $existing->where(static::$slugsLanguageKey, $this->storeSlugForLanguageId());
        }

        $list = $existing->lists(static::$slugsColumn, static::$slugsEntryKey);

        // Laravel 5.0/5.1 check
        return $list instanceof Collection ? $list->all() : $list;
    }
protected function getAllSlugsForModuleFromCmsTable ( $ likeSlug = null , $ limitToLanguage = true ) { /** @var CmsModel|SluggableTrait $this */ $ config = $ this -> getSluggableConfig ( ) ; $ includeTrashed = $ config [ 'include_trashed' ] ; $ separator = $ config [ 'separator' ] ; $ existing = DB :: table ( static :: $ slugsTable ) -> select ( [ 'id' , static :: $ slugsColumn . ' as slug' ] ) -> where ( static :: $ slugsModuleKey , $ this -> getModuleNumber ( ) ) -> where ( function ( $ query ) use ( $ likeSlug , $ separator ) { $ query -> where ( static :: $ slugsColumn , $ likeSlug ) ; $ query -> orWhere ( static :: $ slugsColumn , 'LIKE' , $ likeSlug . $ separator . '%' ) ; } ) ; if ( ! $ includeTrashed && static :: $ slugsActiveColumn ) { $ existing -> where ( static :: $ slugsActiveColumn , true ) ; } if ( $ limitToLanguage ) { $ existing -> where ( static :: $ slugsLanguageKey , $ this -> storeSlugForLanguageId ( ) ) ; } $ list = $ existing -> lists ( static :: $ slugsColumn , static :: $ slugsEntryKey ) ; // Laravel 5.0/5.1 check return $ list instanceof Collection ? $ list -> all ( ) : $ list ; }
Returns current slugs for this module from CMS slugs table

@param string $likeSlug          if set, only returns slugs that are like the string
@param bool   $limitToLanguage   if true, only returns matches within the language
@return null|object
Returns current slugs for this module from CMS slugs table