Completed
Pull Request — master (#21)
by Anton
04:34
created
database/migrations/2016_09_02_153301_create_love_likes_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
      */
28 28
     public function up()
29 29
     {
30
-        Schema::create('love_likes', function (Blueprint $table) {
30
+        Schema::create('love_likes', function(Blueprint $table) {
31 31
             $table->increments('id');
32 32
             $table->morphs('likeable');
33 33
             $table->integer('user_id')->unsigned()->index();
Please login to merge, or discard this patch.
database/migrations/2016_09_02_163301_create_love_like_counters_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
      */
28 28
     public function up()
29 29
     {
30
-        Schema::create('love_like_counters', function (Blueprint $table) {
30
+        Schema::create('love_like_counters', function(Blueprint $table) {
31 31
             $table->increments('id');
32 32
             $table->morphs('likeable');
33 33
             $table->enum('type_id', [
Please login to merge, or discard this patch.
src/Likeable/Services/LikeableService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -427,7 +427,7 @@
 block discarded – undo
427 427
                 continue;
428 428
             }
429 429
 
430
-            return $likeable->{$relation}->contains(function ($item) use ($userId, $typeId) {
430
+            return $likeable->{$relation}->contains(function($item) use ($userId, $typeId) {
431 431
                 return $item->user_id == $userId && $item->type_id === $typeId;
432 432
             });
433 433
         }
Please login to merge, or discard this patch.
src/Likeable/Models/Traits/Likeable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
         $userId = $service->getLikerUserId($userId);
365 365
         $typeId = $service->getLikeTypeId($type);
366 366
 
367
-        return $query->whereHas('likesAndDislikes', function (Builder $innerQuery) use ($typeId, $userId) {
367
+        return $query->whereHas('likesAndDislikes', function(Builder $innerQuery) use ($typeId, $userId) {
368 368
             $innerQuery->where('user_id', $userId);
369 369
             $innerQuery->where('type_id', $typeId);
370 370
         });
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 
389 389
         return $query
390 390
             ->select($likeable->getTable() . '.*', 'love_like_counters.count')
391
-            ->leftJoin('love_like_counters', function (JoinClause $join) use ($likeable, $typeId) {
391
+            ->leftJoin('love_like_counters', function(JoinClause $join) use ($likeable, $typeId) {
392 392
                 $join
393 393
                     ->on('love_like_counters.likeable_id', '=', "{$likeable->getTable()}.{$likeable->getKeyName()}")
394 394
                     ->where('love_like_counters.likeable_type', '=', $likeable->getMorphClass())
Please login to merge, or discard this patch.