HasSlug
trait HasSlug (View source)
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
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
bootHasSlug()
No description
HasMany
slugs()
Defines the one-to-many relationship for slug objects.
object
getSlugClass()
Returns an instance of the slug class for this model.
string|null
getSlugModelClass()
Returns the fully qualified slug class name for this model.
protected
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(bool $restoring = false)
No description
void
updateOrNewSlug(array $slugParams, bool $restoring = false)
No description
object|null
getExistingSlug(array $slugParams)
No description
protected
addOneSlug($slugParams)
No description
void
disableLocaleSlugs(string $locale, int $except_slug_id = 0)
No description
object|null
getActiveSlug(string|null $locale = null)
Returns the active slug object for this model.
object|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
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.