@@ -118,7 +118,7 @@ |
||
118 | 118 | $targets = [$targets]; |
119 | 119 | } |
120 | 120 | |
121 | - $result->ids = array_map(function ($target) use ($result) { |
|
121 | + $result->ids = array_map(function($target) use ($result) { |
|
122 | 122 | if ($target instanceof Model) { |
123 | 123 | $result->classname = get_class($target); |
124 | 124 |
@@ -107,7 +107,7 @@ |
||
107 | 107 | ->wherePivot('relation', '=', Follow::RELATION_FOLLOW) |
108 | 108 | ->withPivot('followable_type', 'relation', 'created_at') |
109 | 109 | ->addSelect("{$targetTable}.*", DB::raw("(CASE WHEN {$tablePrefixedForeignKey} IS NOT NULL THEN 1 ELSE 0 END) as {$eachOtherKey}")) |
110 | - ->leftJoin("{$table} as pivot_followables", function ($join) use ($table, $class, $foreignKey) { |
|
110 | + ->leftJoin("{$table} as pivot_followables", function($join) use ($table, $class, $foreignKey) { |
|
111 | 111 | $join->on('pivot_followables.followable_type', '=', DB::raw(\addcslashes("'{$class}'", '\\'))) |
112 | 112 | ->on('pivot_followables.followable_id', '=', "{$table}.{$foreignKey}") |
113 | 113 | ->on("pivot_followables.{$foreignKey}", '=', "{$table}.followable_id"); |
@@ -49,7 +49,7 @@ |
||
49 | 49 | ->wherePivot('relation', '=', Follow::RELATION_FOLLOW) |
50 | 50 | ->withPivot('followable_type', 'relation', 'created_at') |
51 | 51 | ->addSelect("{$userTable}.*", DB::raw("(CASE WHEN {$tablePrefixedForeignKey} IS NOT NULL THEN 1 ELSE 0 END) as {$eachOtherKey}")) |
52 | - ->leftJoin("{$table} as pivot_followables", function ($join) use ($table, $class, $foreignKey) { |
|
52 | + ->leftJoin("{$table} as pivot_followables", function($join) use ($table, $class, $foreignKey) { |
|
53 | 53 | $join->on('pivot_followables.followable_type', '=', DB::raw(\addcslashes("'{$class}'", '\\'))) |
54 | 54 | ->on('pivot_followables.followable_id', '=', "{$table}.{$foreignKey}") |
55 | 55 | ->on("pivot_followables.{$foreignKey}", '=', "{$table}.followable_id"); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function up() |
21 | 21 | { |
22 | - Schema::create(config('follow.followable_table', 'followables'), function (Blueprint $table) { |
|
22 | + Schema::create(config('follow.followable_table', 'followables'), function(Blueprint $table) { |
|
23 | 23 | $userForeignKey = config('follow.users_table_foreign_key', 'user_id'); |
24 | 24 | |
25 | 25 | // Laravel 5.8 session user is unsignedBigInteger |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function down() |
51 | 51 | { |
52 | - Schema::table(config('follow.followable_table', 'followables'), function ($table) { |
|
52 | + Schema::table(config('follow.followable_table', 'followables'), function($table) { |
|
53 | 53 | $table->dropForeign(config('follow.followable_table', 'followables').'_user_id_foreign'); |
54 | 54 | }); |
55 | 55 |