PHP Trait Spatie\Sluggable\HasSlug

Afficher le fichier Open project: spatie/laravel-sluggable

Protected Properties

Свойство Type Description
$slugOptions SlugOptions

Méthodes publiques

Méthode Description
generateSlug ( ) Handle setting slug on explicit request.
getSlugOptions ( ) : SlugOptions Get the options for generating the slug.

Méthodes protégées

Méthode Description
addSlug ( ) Add the slug to the model.
bootHasSlug ( ) Boot the trait.
generateNonUniqueSlug ( ) : string Generate a non unique slug for this record.
generateSlugOnCreate ( ) Handle adding slug on model creation.
generateSlugOnUpdate ( ) Handle adding slug on model update.
getSlugSourceString ( ) : string Get the string that should be used as base for the slug.
guardAgainstInvalidSlugOptions ( ) This function will throw an exception when any of the options is missing or invalid.
hasCustomSlugBeenUsed ( ) : boolean Determine if a custom slug has been saved.
makeSlugUnique ( string $slug ) : string Make the given slug unique.
otherRecordExistsWithSlug ( string $slug ) : boolean Determine if a record exists with the given slug.

Method Details

addSlug() protected méthode

Add the slug to the model.
protected addSlug ( )

bootHasSlug() protected static méthode

Boot the trait.
protected static bootHasSlug ( )

generateNonUniqueSlug() protected méthode

Generate a non unique slug for this record.
protected generateNonUniqueSlug ( ) : string
Résultat string

generateSlug() public méthode

Handle setting slug on explicit request.
public generateSlug ( )

generateSlugOnCreate() protected méthode

Handle adding slug on model creation.
protected generateSlugOnCreate ( )

generateSlugOnUpdate() protected méthode

Handle adding slug on model update.
protected generateSlugOnUpdate ( )

getSlugOptions() abstract public méthode

Get the options for generating the slug.
abstract public getSlugOptions ( ) : SlugOptions
Résultat SlugOptions

getSlugSourceString() protected méthode

Get the string that should be used as base for the slug.
protected getSlugSourceString ( ) : string
Résultat string

guardAgainstInvalidSlugOptions() protected méthode

This function will throw an exception when any of the options is missing or invalid.

hasCustomSlugBeenUsed() protected méthode

Determine if a custom slug has been saved.
protected hasCustomSlugBeenUsed ( ) : boolean
Résultat boolean

makeSlugUnique() protected méthode

Make the given slug unique.
protected makeSlugUnique ( string $slug ) : string
$slug string
Résultat string

otherRecordExistsWithSlug() protected méthode

Determine if a record exists with the given slug.
protected otherRecordExistsWithSlug ( string $slug ) : boolean
$slug string
Résultat boolean

Property Details

$slugOptions protected_oe property

protected SlugOptions,Spatie\Sluggable $slugOptions
Résultat SlugOptions