Skip to content

Commit 219df35

Browse files
authored
Merge pull request #119 from drolean/laravel-5
On Laravel 5.1.45 return only first register
2 parents ce928fb + 2f16a60 commit 219df35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Taggable.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public function scopeWithAllTags($query, $tagNames)
187187
foreach($tagNames as $tagSlug) {
188188
$tags = Tagged::where('tag_slug', call_user_func($normalizer, $tagSlug))
189189
->where('taggable_type', $className)
190-
->pluck('taggable_id');
190+
->get()->pluck('taggable_id');
191191

192192
$primaryKey = $this->getKeyName();
193193
$query->whereIn($this->getTable().'.'.$primaryKey, $tags);
@@ -218,7 +218,7 @@ public function scopeWithAnyTag($query, $tagNames)
218218

219219
$tags = Tagged::whereIn('tag_slug', $tagNames)
220220
->where('taggable_type', $className)
221-
->pluck('taggable_id');
221+
->get()->pluck('taggable_id');
222222

223223
$primaryKey = $this->getKeyName();
224224
return $query->whereIn($this->getTable().'.'.$primaryKey, $tags);

0 commit comments

Comments
 (0)