PHP Trait Cartalyst\Tags\TaggableTrait

Show file Open project: cartalyst/tags

Protected Properties

Property Type Description
$delimiter string The tags delimiter.
$slugGenerator string The Slug generator method.
$tagsModel string The Eloquent tags model name.

Public Methods

Method Description
addTag ( $name )
allTags ( )
createTagsModel ( )
getSlugGenerator ( )
getTagsDelimiter ( )
getTagsModel ( )
prepareTags ( $tags )
removeTag ( $name )
scopeWhereTag ( Builder $query, $tags, $type = 'slug' )
scopeWithTag ( Builder $query, $tags, $type = 'slug' )
scopeWithoutTag ( Builder $query, $tags, $type = 'slug' )
setSlugGenerator ( $slugGenerator )
setTags ( $tags, $type = 'name' )
setTagsDelimiter ( $delimiter )
setTagsModel ( $model )
tag ( $tags )
tags ( )
untag ( $tags = null )

Protected Methods

Method Description
generateTagSlug ( string $name ) : string Generate the tag slug using the given name.
getEntityClassName ( ) : string Returns the entity class name.

Method Details

addTag() public method

public addTag ( $name )

allTags() public static method

public static allTags ( )

createTagsModel() public static method

public static createTagsModel ( )

generateTagSlug() protected method

Generate the tag slug using the given name.
protected generateTagSlug ( string $name ) : string
$name string
return string

getEntityClassName() protected method

Returns the entity class name.
protected getEntityClassName ( ) : string
return string

getSlugGenerator() public static method

public static getSlugGenerator ( )

getTagsDelimiter() public static method

public static getTagsDelimiter ( )

getTagsModel() public static method

public static getTagsModel ( )

prepareTags() public method

public prepareTags ( $tags )

removeTag() public method

public removeTag ( $name )

scopeWhereTag() public static method

public static scopeWhereTag ( Builder $query, $tags, $type = 'slug' )
$query Illuminate\Database\Eloquent\Builder

scopeWithTag() public static method

public static scopeWithTag ( Builder $query, $tags, $type = 'slug' )
$query Illuminate\Database\Eloquent\Builder

scopeWithoutTag() public static method

public static scopeWithoutTag ( Builder $query, $tags, $type = 'slug' )
$query Illuminate\Database\Eloquent\Builder

setSlugGenerator() public static method

public static setSlugGenerator ( $slugGenerator )

setTags() public method

public setTags ( $tags, $type = 'name' )

setTagsDelimiter() public static method

public static setTagsDelimiter ( $delimiter )

setTagsModel() public static method

public static setTagsModel ( $model )

tag() public method

public tag ( $tags )

tags() public method

public tags ( )

untag() public method

public untag ( $tags = null )

Property Details

$delimiter protected static property

The tags delimiter.
protected static string $delimiter
return string

$slugGenerator protected static property

The Slug generator method.
protected static string $slugGenerator
return string

$tagsModel protected static property

The Eloquent tags model name.
protected static string $tagsModel
return string