Add Social Reactions to Laravel Eloquent Models. It lets people express how they feel about the content. Fully customizable Weighted Reaction System & Reaction Type System with Like, Dislike and any other custom emotion types. Do you react?
MIT License
Bot releases are hidden (Show)
Full Changelog: https://github.com/cybercog/laravel-love/compare/9.0.0...10.0.0
Published by antonkomarev over 1 year ago
Code has breaking changes because of Eloquent Model local scopes refactoring.
Follow upgrade instructions from v8 to v9 to migrate code.
whereReactedTo
model scope to Reacterable modelswhereNotReactedTo
model scope to Reacterable modelswhereReactedToBetween
model scope to Reacterable modelsReactableEloquentBuilderTrait
love:setup-reactable
generates migration with nullable column love_reactant_id
by defaultlove:setup-reactable
option --nullable
replaced with --not-nullable
love:setup-reacterable
generates migration with nullable column love_reacter_id
by defaultlove:setup-reacterable
option --nullable
replaced with --not-nullable
love:recount
use default queue connection if --queue-connection
option is not definedAsCommand
attributeFull Changelog: https://github.com/cybercog/laravel-love/compare/8.9.0...9.0.0
Published by antonkomarev over 2 years ago
Full Changelog: https://github.com/cybercog/laravel-love/compare/8.8.1...8.9.0
Published by antonkomarev over 3 years ago
Published by antonkomarev over 3 years ago
Published by antonkomarev almost 4 years ago
$name
with $defaultName
static property in commandsPublished by antonkomarev almost 4 years ago
Published by antonkomarev about 4 years ago
Published by antonkomarev about 4 years ago
Published by antonkomarev about 4 years ago
Published by antonkomarev over 4 years ago
Published by antonkomarev over 4 years ago
Published by antonkomarev over 4 years ago
Cog\Laravel\Love\Reactant\Listeners\IncrementAggregates
listener to Cog\Laravel\Love\Reactant\Jobs\IncrementReactionAggregatesJob
Cog\Laravel\Love\Reactant\Listeners\DecrementAggregates
listener to Cog\Laravel\Love\Reactant\Jobs\DecrementReactionAggregatesJob
Cog\Laravel\Love\LoveServiceProvider
to Cog\Laravel\Love\LoveEventServiceProvider
Cog\Laravel\Love\Console\Commands\Recount
command to Cog\Laravel\Love\Reactant\Jobs\RebuildReactionAggregatesJob
--queue-connection=
option to love:recount
Artisan commandlove:recount
Artisan command execution when love_reactant_reaction_totals
database table is emptylove:recount
Artisan command return typePublished by antonkomarev over 4 years ago
Published by antonkomarev about 5 years ago
Published by antonkomarev about 5 years ago
Published by antonkomarev about 5 years ago
RateOutOfRange
exception in contracts namespace on concrete Reaction
model implementationwithValue
method to withValueBetween
in RateOutOfRange
exception$minimumRate
parameter to withValueBetween
method in RateOutOfRange
exception$maximumRate
parameter to withValueBetween
method in RateOutOfRange
exception$rate
parameter type from float
to ?float
of hasReactedTo
method in Reacter
model contract$rate
parameter type from float
to ?float
of hasNotReactedTo
method in Reacter
model contractPublished by antonkomarev about 5 years ago
Published by antonkomarev about 5 years ago
Code has a lot of breaking changes because of new Weighted Reaction System.
Follow upgrade instructions to migrate code & database to new structure.
love:upgrade-v7-to-v8
Artisan commandReactionCounter::COUNT_DEFAULT
public constantReactionCounter::WEIGHT_DEFAULT
public constantReactionTotal::COUNT_DEFAULT
public constantReactionTotal::WEIGHT_DEFAULT
public constantReaction::RATE_DEFAULT
public constantReaction::RATE_MIN
public constantReaction::RATE_MAX
public constantReactionType::MASS_DEFAULT
public constantrate
attribute to Reacter
modelrate DECIMIAL(4, 2)
column to love_reactions
db tableReacter::reactTo
with already reacted reactant, same reaction type, but only rate
differsCog\Contracts\Love\Reaction\Exceptions\RateOutOfRange
exceptionCog\Contracts\Love\Reaction\Exceptions\RateInvalid
exceptionlove:recount
Artisan commandReactable::joinReactionCounterOfType
more than oncescopeWhereNotReactedBy
scope to Reactable
model traitisReactedTo
method to hasReactedTo
in Reacter
model contract$reactionType
parameter to hasReactedTo
in Reacter
model contract$rate
parameter to hasReactedTo
method in Reacter
model contract$rate
parameter to hasReactedTo
method in Reacter
facade contractisNotReactedTo
method to hasNotReactedTo
in Reacter
model contract$reactionType
parameter to hasNotReactedTo
in Reacter
model contract$rate
parameter to hasNotReactedTo
method in Reacter
model contract$rate
parameter to hasNotReactedTo
method in Reacter
facade contract$reactionType
parameter to isReactedBy
in Reactant
model contract$rate
parameter to isReactedBy
method in Reactant
model contract$rate
parameter to isReactedBy
method in Reactant
facade contract$reactionType
parameter to isNotReactedBy
in Reactant
model contract$rate
parameter to isNotReactedBy
method in Reactant
model contract$rate
parameter to isNotReactedBy
method in Reactant
facade contractlove:reaction-type-add
awaits options instead of argumentsweight
attribute to mass
in ReactionType
modelgetWeight
method to getMass
in ReactionType
model contract$reactionType
parameter to scopeWhereReactedBy
method in Reactable
model traitcount
& weight
attributes default values of ReactionCounter
to application levelcount
& weight
attributes default values of ReactionTotal
to application levelgetWeight
method return type from int
to float
in reactant's ReactionCounter
model contract$amount
parameter type from int
to float
of incrementWeight
method in reactant's ReactionCounter
model contract$amount
parameter type from int
to float
of decrementWeight
method in reactant's ReactionCounter
model contractgetWeight
method return type from int
to float
in reactant's ReactionTotal
model contract$amount
parameter type from int
to float
of incrementWeight
method in reactant's ReactionTotal
model contract$amount
parameter type from int
to float
of decrementWeight
method in reactant's ReactionTotal
model contract?float $rate
parameter to reactTo
method in Reacter
facade contract?float $rate
parameter to reactTo
method in Reacter
model contractgetRate
method to Reaction
model contractgetWeight
method return type from int
to float
in Reaction
model contractweight
column type to DECIMIAL(13, 2)
in love_reactant_reaction_counters
db tableweight
column type to DECIMIAL(13, 2)
in love_reactant_reaction_totals
db tablelove:recount
Artisan command to love:recount {--model=} {--type=}
Reacterable
parameter nullable in isReactedBy
method of Reactant
facade contractReacterable
parameter nullable in isNotReactedBy
method of Reactant
facade contractReactant
to Reacterable
in scopeWhereReactedBy
method of Reactable
model trait?ReactionType
to ?string
in scopeWhereReactedBy
method of Reactable
model trait?string $alias
parameter to scopeJoinReactionCounterOfType
method of Reactable
model trait?string $alias
parameter to scopeJoinReactionTotal
method of Reactable
model traitreactions_count
to reaction_{$type}_count
in scopeJoinReactionCounterOfType
method of Reactable
model traitreactions_weight
to reaction_{$type}_weight
in scopeJoinReactionCounterOfType
method of Reactable
model traitreactions_total_count
to reaction_total_count
in scopeJoinReactionTotal
method of Reactable
model traitreactions_total_weight
to reaction_total_weight
in scopeJoinReactionTotal
method of Reactable
model traitisReactedToWithType
method from Reacter
model contractisNotReactedToWithType
method from Reacter
model contractisReactedByWithType
method from Reactant
model contractisNotReactedByWithType
method Reactant
model contractscopeWhereReactedByWithType
method from Reactable
model traitPublished by antonkomarev over 5 years ago