PHP Interface Cviebrock\EloquentTaggable\Taggable

Afficher le fichier Open project: cviebrock/eloquent-taggable

Méthodes publiques

Méthode Description
allTags ( ) : array Get an array of all tags used for the called class.
allTagsList ( ) : string Get all the tags used for the called class as a delimited string.
detag ( ) Remove all tags from the model.
getTagArrayAttribute ( ) : array Get all tags of a Model as an array.
getTagArrayNormalizedAttribute ( ) : array Get all normalized tags of a Model as an array.
getTagListAttribute ( ) : string Get all tags of a Model as a string in which the tags are delimited by the character defined in config('taggable.delimiters').
getTagListNormalizedAttribute ( ) : string Get all normalized tags of a Model as a string in which the tags are delimited by the character defined in config('taggable.delimiters').
retag ( string | array $tags ) Remove all Tags from a Model and assign the given ones.
scopeWithAllTags ( Builder $query, array | string $tags ) : Builder Scope for a Model that has all of the given tags.
scopeWithAnyTags ( Builder $query, array $tags = [] ) : Builder Scope for a Model that has any of the given tags.
scopeWithoutTags ( Builder $query ) : Builder Scope for a Model that doesn't have any tags.
tag ( string | array $tags ) Attach one or multiple Tags to a Model.
tags ( ) : Illuminate\Database\Eloquent\Relations\MorphToMany Get a collection of all Tags a Model has.
untag ( string | array $tags ) Detach one or multiple Tags from a Model.

Méthodes protégées

Méthode Description
addOneTag ( string $tagName ) Add one tag to the model.
removeOneTag ( string $tagName ) Remove one tag from the model

Method Details

addOneTag() protected méthode

Add one tag to the model.
protected addOneTag ( string $tagName )
$tagName string

allTags() public static méthode

Get an array of all tags used for the called class.
public static allTags ( ) : array
Résultat array

allTagsList() public static méthode

Get all the tags used for the called class as a delimited string.
public static allTagsList ( ) : string
Résultat string

detag() public méthode

Remove all tags from the model.
public detag ( )

getTagArrayAttribute() public méthode

Get all tags of a Model as an array.
public getTagArrayAttribute ( ) : array
Résultat array

getTagArrayNormalizedAttribute() public méthode

Get all normalized tags of a Model as an array.
public getTagArrayNormalizedAttribute ( ) : array
Résultat array

getTagListAttribute() public méthode

Get all tags of a Model as a string in which the tags are delimited by the character defined in config('taggable.delimiters').
public getTagListAttribute ( ) : string
Résultat string

getTagListNormalizedAttribute() public méthode

Get all normalized tags of a Model as a string in which the tags are delimited by the character defined in config('taggable.delimiters').

removeOneTag() protected méthode

Remove one tag from the model
protected removeOneTag ( string $tagName )
$tagName string

retag() public méthode

Remove all Tags from a Model and assign the given ones.
public retag ( string | array $tags )
$tags string | array

scopeWithAllTags() public méthode

Scope for a Model that has all of the given tags.
public scopeWithAllTags ( Builder $query, array | string $tags ) : Builder
$query Illuminate\Database\Eloquent\Builder
$tags array | string
Résultat Illuminate\Database\Eloquent\Builder

scopeWithAnyTags() public méthode

Scope for a Model that has any of the given tags.
public scopeWithAnyTags ( Builder $query, array $tags = [] ) : Builder
$query Illuminate\Database\Eloquent\Builder
$tags array
Résultat Illuminate\Database\Eloquent\Builder

scopeWithoutTags() public méthode

Scope for a Model that doesn't have any tags.
public scopeWithoutTags ( Builder $query ) : Builder
$query Illuminate\Database\Eloquent\Builder
Résultat Illuminate\Database\Eloquent\Builder

tag() public méthode

Attach one or multiple Tags to a Model.
public tag ( string | array $tags )
$tags string | array

tags() public méthode

Get a collection of all Tags a Model has.
public tags ( ) : Illuminate\Database\Eloquent\Relations\MorphToMany
Résultat Illuminate\Database\Eloquent\Relations\MorphToMany

untag() public méthode

Detach one or multiple Tags from a Model.
public untag ( string | array $tags )
$tags string | array