TagRepository
class TagRepository
TagRepository.php
Traits
Properties
static protected array | $models | model class name | from EloquentRepositoryTrait |
Methods
Increment a column's value by a given amount.
Decrement a column's value by a given amount.
Returns tags of the taggable
Returns most popular tags
Returns most popular tags in whole
Returns most popular tags of date period
Returns most popular tags of date period in whole
Search similar tags by given string
Details
in EloquentRepositoryTrait at line 42
Model
update(Model $item, array $data = array())
update
in EloquentRepositoryTrait at line 56
bool|null
delete(Model $item)
delete
in EloquentRepositoryTrait at line 69
int
increment(Model $item, string $column, int $amount = 1)
Increment a column's value by a given amount.
in EloquentRepositoryTrait at line 82
int
decrement(Model $item, string $column, int $amount = 1)
Decrement a column's value by a given amount.
in EloquentRepositoryTrait at line 92
static string
getModel()
The name of Category model class
in EloquentRepositoryTrait at line 103
static void
setModel(string $model)
Set the name of Category model
in EloquentRepositoryTrait at line 113
Model
createModel()
Create model instance
in EloquentRepositoryTrait at line 125
Builder
query()
query
in EloquentRepositoryTrait at line 137
mixed
__call(string $name, array $arguments)
__call
at line 44
void
attach(string $taggableId, Tag[] $tags)
Attach tag to taggable
at line 84
void
detach(string $taggableId, Tag[] $tags)
Detach tag to taggable
at line 104
Collection|Tag[]
fetchByTaggable(string $taggableId)
Returns tags of the taggable
at line 123
Collection|Tag[]
fetchPopular(string|null $instanceId = null, int $take = 15)
Returns most popular tags
at line 140
Collection|Tag[]
fetPopularWhole(int $take = 15)
Returns most popular tags in whole
at line 154
Collection|Tag[]
fetchPopularPeriod(DateTime|string $since, DateTime|string|null $until = null, string|null $instanceId = null, int $take = 15)
Returns most popular tags of date period
at line 187
Collection|Tag[]
fetchPopularPeriodWhole(DateTime|string $since, DateTime|string|null $until = null, int $take = 15)
Returns most popular tags of date period in whole
at line 200
Collection|Tag[]
fetchSimilar(string $decomposed, int $take = 15, string|null $instanceId = null)
Search similar tags by given string
at line 219
protected DateTime|Carbon
getNow()
Returns Datetime instance for now