PHP Интерфейс Cviebrock\EloquentTaggable\Taggable

Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
addOneTag ( string $tagName ) Add one tag to the model.
removeOneTag ( string $tagName ) Remove one tag from the model

Описание методов

addOneTag() защищенный Метод

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

allTags() публичный статический Метод

Get an array of all tags used for the called class.
public static allTags ( ) : array
Результат array

allTagsList() публичный статический Метод

Get all the tags used for the called class as a delimited string.
public static allTagsList ( ) : string
Результат string

detag() публичный Метод

Remove all tags from the model.
public detag ( )

getTagArrayAttribute() публичный Метод

Get all tags of a Model as an array.
public getTagArrayAttribute ( ) : array
Результат array

getTagArrayNormalizedAttribute() публичный Метод

Get all normalized tags of a Model as an array.
public getTagArrayNormalizedAttribute ( ) : array
Результат array

getTagListAttribute() публичный Метод

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
Результат string

getTagListNormalizedAttribute() публичный Метод

Get all normalized tags of a Model as a string in which the tags are delimited by the character defined in config('taggable.delimiters').
public getTagListNormalizedAttribute ( ) : string
Результат string

removeOneTag() защищенный Метод

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

retag() публичный Метод

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

scopeWithAllTags() публичный Метод

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
Результат Illuminate\Database\Eloquent\Builder

scopeWithAnyTags() публичный Метод

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
Результат Illuminate\Database\Eloquent\Builder

scopeWithoutTags() публичный Метод

Scope for a Model that doesn't have any tags.
public scopeWithoutTags ( Builder $query ) : Builder
$query Illuminate\Database\Eloquent\Builder
Результат Illuminate\Database\Eloquent\Builder

tag() публичный Метод

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

tags() публичный Метод

Get a collection of all Tags a Model has.
public tags ( ) : Illuminate\Database\Eloquent\Relations\MorphToMany
Результат Illuminate\Database\Eloquent\Relations\MorphToMany

untag() публичный Метод

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