@@ -24,7 +24,7 @@  | 
                                                    ||
| 24 | 24 | */  | 
                                                        
| 25 | 25 | public function up(): void  | 
                                                        
| 26 | 26 |      { | 
                                                        
| 27 | -        Schema::create('love_reactions', function (Blueprint $table) { | 
                                                        |
| 27 | +        Schema::create('love_reactions', function(Blueprint $table) { | 
                                                        |
| 28 | 28 |              $table->bigIncrements('id'); | 
                                                        
| 29 | 29 |              $table->unsignedBigInteger('reactant_id'); | 
                                                        
| 30 | 30 |              $table->unsignedBigInteger('reacter_id'); | 
                                                        
@@ -24,7 +24,7 @@  | 
                                                    ||
| 24 | 24 | */  | 
                                                        
| 25 | 25 | public function up(): void  | 
                                                        
| 26 | 26 |      { | 
                                                        
| 27 | -        Schema::create('love_reactant_reaction_counters', function (Blueprint $table) { | 
                                                        |
| 27 | +        Schema::create('love_reactant_reaction_counters', function(Blueprint $table) { | 
                                                        |
| 28 | 28 |              $table->bigIncrements('id'); | 
                                                        
| 29 | 29 |              $table->unsignedBigInteger('reactant_id'); | 
                                                        
| 30 | 30 |              $table->unsignedBigInteger('reaction_type_id'); | 
                                                        
@@ -24,7 +24,7 @@  | 
                                                    ||
| 24 | 24 | */  | 
                                                        
| 25 | 25 | public function up(): void  | 
                                                        
| 26 | 26 |      { | 
                                                        
| 27 | -        Schema::create('love_reaction_types', function (Blueprint $table) { | 
                                                        |
| 27 | +        Schema::create('love_reaction_types', function(Blueprint $table) { | 
                                                        |
| 28 | 28 |              $table->bigIncrements('id'); | 
                                                        
| 29 | 29 |              $table->string('name'); | 
                                                        
| 30 | 30 |              $table->tinyInteger('weight'); | 
                                                        
@@ -24,7 +24,7 @@  | 
                                                    ||
| 24 | 24 | */  | 
                                                        
| 25 | 25 | public function up(): void  | 
                                                        
| 26 | 26 |      { | 
                                                        
| 27 | -        Schema::create('love_reacters', function (Blueprint $table) { | 
                                                        |
| 27 | +        Schema::create('love_reacters', function(Blueprint $table) { | 
                                                        |
| 28 | 28 |              $table->bigIncrements('id'); | 
                                                        
| 29 | 29 |              $table->string('type'); | 
                                                        
| 30 | 30 | $table->timestamps();  | 
                                                        
@@ -24,7 +24,7 @@  | 
                                                    ||
| 24 | 24 | */  | 
                                                        
| 25 | 25 | public function up(): void  | 
                                                        
| 26 | 26 |      { | 
                                                        
| 27 | -        Schema::create('love_reactants', function (Blueprint $table) { | 
                                                        |
| 27 | +        Schema::create('love_reactants', function(Blueprint $table) { | 
                                                        |
| 28 | 28 |              $table->bigIncrements('id'); | 
                                                        
| 29 | 29 |              $table->string('type'); | 
                                                        
| 30 | 30 | $table->timestamps();  | 
                                                        
@@ -24,7 +24,7 @@  | 
                                                    ||
| 24 | 24 | */  | 
                                                        
| 25 | 25 | public function up(): void  | 
                                                        
| 26 | 26 |      { | 
                                                        
| 27 | -        Schema::create('love_reactant_reaction_totals', function (Blueprint $table) { | 
                                                        |
| 27 | +        Schema::create('love_reactant_reaction_totals', function(Blueprint $table) { | 
                                                        |
| 28 | 28 |              $table->bigIncrements('id'); | 
                                                        
| 29 | 29 |              $table->unsignedBigInteger('reactant_id'); | 
                                                        
| 30 | 30 |              $table->unsignedBigInteger('count')->default(0); | 
                                                        
@@ -76,7 +76,7 @@ discard block  | 
                                                    ||
| 76 | 76 | Builder $query,  | 
                                                        
| 77 | 77 | ReacterContract $reacter  | 
                                                        
| 78 | 78 |      ): Builder { | 
                                                        
| 79 | -        return $query->whereHas('loveReactant.reactions', function (Builder $reactionsQuery) use ($reacter) { | 
                                                        |
| 79 | +        return $query->whereHas('loveReactant.reactions', function(Builder $reactionsQuery) use ($reacter) { | 
                                                        |
| 80 | 80 |              $reactionsQuery->where('reacter_id', $reacter->getId()); | 
                                                        
| 81 | 81 | });  | 
                                                        
| 82 | 82 | }  | 
                                                        
@@ -86,7 +86,7 @@ discard block  | 
                                                    ||
| 86 | 86 | ReacterContract $reacter,  | 
                                                        
| 87 | 87 | ReactionTypeContract $reactionType  | 
                                                        
| 88 | 88 |      ): Builder { | 
                                                        
| 89 | -        return $query->whereHas('loveReactant.reactions', function (Builder $reactionsQuery) use ($reacter, $reactionType) { | 
                                                        |
| 89 | +        return $query->whereHas('loveReactant.reactions', function(Builder $reactionsQuery) use ($reacter, $reactionType) { | 
                                                        |
| 90 | 90 |              $reactionsQuery->where('reacter_id', $reacter->getId()); | 
                                                        
| 91 | 91 |              $reactionsQuery->where('reaction_type_id', $reactionType->getId()); | 
                                                        
| 92 | 92 | });  | 
                                                        
@@ -101,7 +101,7 @@ discard block  | 
                                                    ||
| 101 | 101 |          $select[] = DB::raw('COALESCE(lrrc.weight, 0) as reactions_weight'); | 
                                                        
| 102 | 102 | |
| 103 | 103 | return $query  | 
                                                        
| 104 | -            ->leftJoin((new ReactionCounter())->getTable() . ' as lrrc', function (JoinClause $join) use ($reactionType) { | 
                                                        |
| 104 | +            ->leftJoin((new ReactionCounter())->getTable() . ' as lrrc', function(JoinClause $join) use ($reactionType) { | 
                                                        |
| 105 | 105 |                  $join->on('lrrc.reactant_id', '=', "{$this->getTable()}.love_reactant_id"); | 
                                                        
| 106 | 106 |                  $join->where('lrrc.reaction_type_id', $reactionType->getId()); | 
                                                        
| 107 | 107 | })  | 
                                                        
@@ -40,11 +40,11 @@  | 
                                                    ||
| 40 | 40 |      { | 
                                                        
| 41 | 41 | parent::boot();  | 
                                                        
| 42 | 42 | |
| 43 | -        static::saved(function (ReactionTypeContract $reactionType) { | 
                                                        |
| 43 | +        static::saved(function(ReactionTypeContract $reactionType) { | 
                                                        |
| 44 | 44 | static::$nameCache[$reactionType->getName()] = $reactionType;  | 
                                                        
| 45 | 45 | });  | 
                                                        
| 46 | 46 | |
| 47 | -        static::deleted(function (ReactionTypeContract $reactionType) { | 
                                                        |
| 47 | +        static::deleted(function(ReactionTypeContract $reactionType) { | 
                                                        |
| 48 | 48 | unset(static::$nameCache[$reactionType->getName()]);  | 
                                                        
| 49 | 49 | });  | 
                                                        
| 50 | 50 | }  | 
                                                        
@@ -126,7 +126,7 @@ discard block  | 
                                                    ||
| 126 | 126 |          if ($this->relationLoaded('reactions')) { | 
                                                        
| 127 | 127 | return $this  | 
                                                        
| 128 | 128 |                  ->getAttribute('reactions') | 
                                                        
| 129 | -                ->contains(function (ReactionContract $reaction) use ($reacter) { | 
                                                        |
| 129 | +                ->contains(function(ReactionContract $reaction) use ($reacter) { | 
                                                        |
| 130 | 130 | return $reaction->isByReacter($reacter);  | 
                                                        
| 131 | 131 | });  | 
                                                        
| 132 | 132 | }  | 
                                                        
@@ -154,7 +154,7 @@ discard block  | 
                                                    ||
| 154 | 154 |          if ($this->relationLoaded('reactions')) { | 
                                                        
| 155 | 155 | return $this  | 
                                                        
| 156 | 156 |                  ->getAttribute('reactions') | 
                                                        
| 157 | -                ->contains(function (ReactionContract $reaction) use ($reacter, $reactionType) { | 
                                                        |
| 157 | +                ->contains(function(ReactionContract $reaction) use ($reacter, $reactionType) { | 
                                                        |
| 158 | 158 | return $reaction->isByReacter($reacter)  | 
                                                        
| 159 | 159 | && $reaction->isOfType($reactionType);  | 
                                                        
| 160 | 160 | });  |