HasSlug
trait HasSlug (View source)
Properties
array | $twillSlugData |
Methods
No description
Defines the one-to-many relationship for slug objects.
Returns an instance of the slug class for this model.
Returns the fully qualified slug class name for this model.
No description
No description
No description
No description
No description
No description
When a new model is created there is more than one language, we generate the slugs where there is no locale variant yet based on the source.
No description
No description
No description
No description
Returns the active slug object for this model.
Returns the fallback active slug object for this model.
Returns the active slug string for this model.
No description
No description
No description
Returns the database table name for this model's slugs.
Returns the database foreign key column name for this model.
No description
Generate a URL friendly slug from a UTF-8 string.
Generate a URL friendly slug from a given string.
Returns the fully qualified namespace for this model.
Details
static protected void
bootHasSlug()
No description
HasMany
slugs()
Defines the one-to-many relationship for slug objects.
string
getSlugClass()
Returns an instance of the slug class for this model.
string
getSlugModelClass()
Returns the fully qualified slug class name for this model.
protected string
getSlugClassName()
No description
Builder
scopeForSlug(Builder $query, string $slug)
No description
Builder
scopeForInactiveSlug(Builder $query, string $slug)
No description
Builder
scopeForFallbackLocaleSlug(Builder $query, string $slug)
No description
void
setSlugs()
No description
void
restoreSlugs()
No description
void
handleSlugsOnSave()
When a new model is created there is more than one language, we generate the slugs where there is no locale variant yet based on the source.
void
updateOrNewSlug(array $slugParams)
No description
Model|null
getExistingSlug(array $slugParams, bool $forRecreate = false)
No description
protected void
addOneSlug(array $slugParams)
No description
void
disableLocaleSlugs(string $locale, int $except_slug_id = 0)
No description
Model|null
getActiveSlug(string|null $locale = null)
Returns the active slug object for this model.
Model|null
getFallbackActiveSlug()
Returns the fallback active slug object for this model.
string
getSlug(string|null $locale = null)
Returns the active slug string for this model.
string
getSlugAttribute()
No description
array|null
getSlugParams(string|null $locale = null)
No description
array|null
getSingleSlugParams(string|null $locale = null)
No description
string
getSlugsTable()
Returns the database table name for this model's slugs.
string
getForeignKey()
Returns the database foreign key column name for this model.
protected string|int
getSuffixSlug()
No description
string
getUtf8Slug(string $str, array $options = [])
Generate a URL friendly slug from a UTF-8 string.
string
urlSlugShorter(string $string)
Generate a URL friendly slug from a given string.
string
getNamespace()
Returns the fully qualified namespace for this model.