public function generateTitleSlug(array $fields)
    {
        static $attempts = 0;

        $titleSlug = Slug::fromTitle(implode('-', $this->getTitleFields($fields)));

        // This is not the first time we've attempted to create a title slug, so - let's make it more unique
        if ($attempts > 0) {
            $titleSlug . "-{$attempts}";
        }

        $this->setSlugValue($titleSlug);

        $attempts++;
    }
public function generateTitleSlug(array $fields)
    {
        static $attempts = 0;

        $titleSlug = Slug::fromTitle(implode('-', $this->getTitleFields($fields)));

        // This is not the first time we've attempted to create a title slug, so - let's make it more unique
        if ($attempts > 0) {
            $titleSlug . "-{$attempts}";
        }

        $this->setSlugValue($titleSlug);

        $attempts++;
    }
public function generateTitleSlug ( array $ fields ) { static $ attempts = 0 ; $ titleSlug = Slug :: fromTitle ( implode ( '-' , $ this -> getTitleFields ( $ fields ) ) ) ; // This is not the first time we've attempted to create a title slug, so - let's make it more unique if ( $ attempts > 0 ) { $ titleSlug . "-{$attempts}" ; } $ this -> setSlugValue ( $ titleSlug ) ; $ attempts ++ ; }
Generate a slug string based on the fields required.
Generate a slug string based on the fields required .